astoff / comint-mime

Display graphics and other MIME attachments in Emacs shells
67 stars 6 forks source link

Customize the ipython shell displayed plot and font size in comint buffer. #4

Closed hongyi-zhao closed 3 years ago

hongyi-zhao commented 3 years ago

Currently, I'm using the comint-mime package with the following configuration:

(use-package comint-mime
  :straight (:host github :repo "astoff/comint-mime"
             :files (:defaults "*.py" "*.sh"))
  :hook ((shell-mode inferior-python-mode) . comint-mime-setup))

With the help of this package, I can display python matplotlib plot and LaTeX formula in Emacs comint buffer, as shown in the screenshot below:

image

But I want to know if I can customize the ipython shell displayed plot and font size in comint buffer. Any hints will be appreciated.

Regards, HZ

astoff commented 3 years ago

For the LaTeX conversion, see org-format-latex-options (you could have discovered this by looking at the code to see which function handles LaTeX stuff).

As to the plot, they are just images, you can't do anything on the Emacs side. If you're making these images with Matplolib, then look up its documentation to see how to customize things.

hongyi-zhao commented 3 years ago

For the LaTeX conversion, see org-format-latex-options

Thank you. The following configuration does the trick:

(use-package comint-mime
  :straight (:host github :repo "astoff/comint-mime"
             :files (:defaults "*.py" "*.sh"))
  :hook ((shell-mode inferior-python-mode) . comint-mime-setup))
  :custom
  (org-format-latex-options '(plist-put org-format-latex-options :scale 1.5))

As to the plot, they are just images, you can't do anything on the Emacs side.

Based on the comments here, I find the following Emacs commands to do the trick:

image-increase-size
image-decrease-size
image-mouse-increase-size
image-mouse-decrease-size