vale981 / py-vterm-interaction.el

A simple vterm-based mode for an inferior (i)Python REPL process in Emacs
GNU General Public License v3.0
23 stars 0 forks source link

figure/plot window? #1

Open downward-funarg opened 5 months ago

downward-funarg commented 5 months ago

Hi,

This looks great! On your reddit post, I saw in the screenshot that you were able to have figures open in a new emacs window (like julia-vterm). Is this feature pushed, and if so how do I use it?

Thank you!

vale981 commented 5 months ago

This is a GTK window. The functionality is part of matplotlib. See https://matplotlib.org/stable/users/explain/figure/backends.html

If you can pitch me an improvement to that I'd be glad to implement it. But right now, I'm reluctant to implement functionality that's already available elsewhere :).

I have this in my ipython initialization.

$ cat .ipython/profile_default/startup/00-matplotlib.ipy 
try:
    %config InlineBackend.figure_formats = ['svg']
    import matplotlib.pyplot as plt
    import matplotlib
    matplotlib.use("GTK3Cairo")
    plt.ion()
except Exception:
    pass
downward-funarg commented 5 months ago

I see, this is a tiling window manager. Should have looked closer :)

vale981 commented 5 months ago

@downward-funarg Haha, I just realized that my above response might have sounded a little blunt. What I meant to convey is: If you have a good use case for rendering the plots in emacs rather than through the matplotlib gui backend, then please tell me.

I have at least 2:

downward-funarg commented 5 months ago

Those are mine as well. Specifically, having a figure window like RStudio would be great!

vale981 commented 5 months ago

For the second point see: https://github.com/matplotlib/matplotlib/issues/28259#issuecomment-2119308405 (I feel a bit stupid now for not realizing this)

The first one: how does the figure window in rstudio work. what does it do? One could potentially handle stuff through a custom matplotlib backend...