millejoh / emacs-ipython-notebook

Jupyter notebook client in Emacs
http://millejoh.github.io/emacs-ipython-notebook/
GNU General Public License v3.0
1.47k stars 122 forks source link

Image handling with external viewer #828

Closed gzagatti closed 2 years ago

gzagatti commented 2 years ago

This is an awesome program, I'm really in love with it. Finally, I can do all my work on a text editor.

There is only one thing that I would like to understand better with regards to image handling. When I choose to view images with an external viewer, it seems like the images are downloaded to a temporary folder in /tmp. I have a few questions:

  1. Is it possible to change the location in which images are saved?
  2. Is it possible to change the naming convention (e.g. after the execution count, id and/or timestamp)?
  3. Is it possible to request the images without actually executing the code?

Thanks for your help!

dickmao commented 2 years ago

As far as I know the images are created on the fly in memory. The answer to all your questions is "no."

gzagatti commented 2 years ago

Would it be possible to have a setting where the images get downloaded, such that I don't need to execute code and fetch it over and over again?

Or would it be at least possible just to request the image, if the code has already been executed? Some plots can take a long time to execute.

I'm using Emacs from a terminal (Kitty), so it's not possible to display the images inline in Emacs. Below you can see the solution I came up with and you can read more details in this thread.

image

dickmao commented 2 years ago

I cannot help you. Incidentally, and you will learn this over time, you are better off generating and displaying plots directly from the shell.

EIN is a neat parlor trick, but it's not suitable for real work.

gzagatti commented 2 years ago

Thanks! I'll see what I can do. For now it's just a proof of concept.

However, I you're too humble to say that EIN is just a neat parlor trick. It works pretty well and it's quite robust, so it gets the job done.