help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Show the figure created by matplotlib in Emacs' frame.


From: Joost Kremers
Subject: Re: Show the figure created by matplotlib in Emacs' frame.
Date: Thu, 16 Sep 2021 20:45:00 +0200
User-agent: mu4e 1.6.3; emacs 27.2.50

On Thu, Sep 16 2021, Hongyi Zhao wrote:
> In Emacs, I run the python script [1] using `C-c C-c' provided with
> the elpy package. A standalone window will be opened to show the
> generated figure, as shown in the attached screenshot file.
>
> But I want to know whether I can let Emacs render the figure in its own frame.
>
> [1] https://github.com/hongyi-zhao/QEbandplot/blob/master/bandplot.py
>
> Any hints will be greatly appreciated.

I have nothing ready-made to offer, but one option that comes to mind is to save
the plot to a file instead of calling `plt.show()` and then have Emacs open that
file.

An alternative would be to use Org mode and put your code in a source block,
then you can have the plot appear directly in your Org file below the source
code.


-- 
Joost Kremers
Life has its moments



reply via email to

[Prev in Thread] Current Thread [Next in Thread]