unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Show the figure created by matplotlib in Emacs' frame.
@ 2021-09-16 15:04 Hongyi Zhao
  2021-09-16 18:45 ` Joost Kremers
  2021-09-18 10:04 ` James Thomas
  0 siblings, 2 replies; 7+ messages in thread
From: Hongyi Zhao @ 2021-09-16 15:04 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 609 bytes --]

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.

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province

[-- Attachment #2: matplotlib.png --]
[-- Type: image/png, Size: 170643 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Show the figure created by matplotlib in Emacs' frame.
  2021-09-16 15:04 Show the figure created by matplotlib in Emacs' frame Hongyi Zhao
@ 2021-09-16 18:45 ` Joost Kremers
  2021-09-18 10:04 ` James Thomas
  1 sibling, 0 replies; 7+ messages in thread
From: Joost Kremers @ 2021-09-16 18:45 UTC (permalink / raw)
  To: Hongyi Zhao; +Cc: help-gnu-emacs


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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Show the figure created by matplotlib in Emacs' frame.
  2021-09-16 15:04 Show the figure created by matplotlib in Emacs' frame Hongyi Zhao
  2021-09-16 18:45 ` Joost Kremers
@ 2021-09-18 10:04 ` James Thomas
  2021-09-18 11:41   ` Hongyi Zhao
  2021-09-19 14:49   ` Hongyi Zhao
  1 sibling, 2 replies; 7+ messages in thread
From: James Thomas @ 2021-09-18 10:04 UTC (permalink / raw)
  To: Hongyi Zhao; +Cc: help-gnu-emacs

Hongyi Zhao wrote:

> But I want to know whether I can let Emacs render the figure in its own frame.

(To add to what is already suggested) I've heard of a new package for
this.

https://github.com/astoff/comint-mime



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Show the figure created by matplotlib in Emacs' frame.
  2021-09-18 10:04 ` James Thomas
@ 2021-09-18 11:41   ` Hongyi Zhao
  2021-09-19 14:49   ` Hongyi Zhao
  1 sibling, 0 replies; 7+ messages in thread
From: Hongyi Zhao @ 2021-09-18 11:41 UTC (permalink / raw)
  To: James Thomas; +Cc: help-gnu-emacs

On Sat, Sep 18, 2021 at 6:02 PM James Thomas <jimjoe@gmx.net> wrote:
>
> Hongyi Zhao wrote:
>
> > But I want to know whether I can let Emacs render the figure in its own frame.
>
> (To add to what is already suggested) I've heard of a new package for
> this.
>
> https://github.com/astoff/comint-mime

Thank you for letting me know this.

Best, HZ



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Show the figure created by matplotlib in Emacs' frame.
  2021-09-18 10:04 ` James Thomas
  2021-09-18 11:41   ` Hongyi Zhao
@ 2021-09-19 14:49   ` Hongyi Zhao
  2021-09-21 12:51     ` Hongyi Zhao
  1 sibling, 1 reply; 7+ messages in thread
From: Hongyi Zhao @ 2021-09-19 14:49 UTC (permalink / raw)
  To: James Thomas; +Cc: help-gnu-emacs

On Sat, Sep 18, 2021 at 6:02 PM James Thomas <jimjoe@gmx.net> wrote:
>
> Hongyi Zhao wrote:
>
> > But I want to know whether I can let Emacs render the figure in its own frame.
>
> (To add to what is already suggested) I've heard of a new package for
> this.
>
> https://github.com/astoff/comint-mime

With the help from the developer of the package above, I've finally
solved the problem discussed here, see [1] fore detailed information.

[1] https://github.com/astoff/comint-mime/issues/2#issuecomment-922462074

Best, HZ



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Show the figure created by matplotlib in Emacs' frame.
  2021-09-19 14:49   ` Hongyi Zhao
@ 2021-09-21 12:51     ` Hongyi Zhao
  2021-09-21 13:34       ` Hongyi Zhao
  0 siblings, 1 reply; 7+ messages in thread
From: Hongyi Zhao @ 2021-09-21 12:51 UTC (permalink / raw)
  To: James Thomas; +Cc: help-gnu-emacs

On Sun, Sep 19, 2021 at 10:49 PM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
>
> On Sat, Sep 18, 2021 at 6:02 PM James Thomas <jimjoe@gmx.net> wrote:
> >
> > Hongyi Zhao wrote:
> >
> > > But I want to know whether I can let Emacs render the figure in its own frame.
> >
> > (To add to what is already suggested) I've heard of a new package for
> > this.
> >
> > https://github.com/astoff/comint-mime
>
> With the help from the developer of the package above, I've finally
> solved the problem discussed here, see [1] fore detailed information.
>
> [1] https://github.com/astoff/comint-mime/issues/2#issuecomment-922462074

Supplementary note: Another tool that can do similar work is python-cell.el [1].

[1] https://github.com/thisch/python-cell.el.

Best, HZ



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Show the figure created by matplotlib in Emacs' frame.
  2021-09-21 12:51     ` Hongyi Zhao
@ 2021-09-21 13:34       ` Hongyi Zhao
  0 siblings, 0 replies; 7+ messages in thread
From: Hongyi Zhao @ 2021-09-21 13:34 UTC (permalink / raw)
  To: James Thomas; +Cc: help-gnu-emacs

On Tue, Sep 21, 2021 at 8:51 PM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
>
> On Sun, Sep 19, 2021 at 10:49 PM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
> >
> > On Sat, Sep 18, 2021 at 6:02 PM James Thomas <jimjoe@gmx.net> wrote:
> > >
> > > Hongyi Zhao wrote:
> > >
> > > > But I want to know whether I can let Emacs render the figure in its own frame.
> > >
> > > (To add to what is already suggested) I've heard of a new package for
> > > this.
> > >
> > > https://github.com/astoff/comint-mime
> >
> > With the help from the developer of the package above, I've finally
> > solved the problem discussed here, see [1] fore detailed information.
> >
> > [1] https://github.com/astoff/comint-mime/issues/2#issuecomment-922462074
>
> Supplementary note: Another tool that can do similar work is python-cell.el [1].
>
> [1] https://github.com/thisch/python-cell.el.

Maybe I misunderstood the function of this package. See here [1] for
the relevant issue filed by me.

[1] https://github.com/thisch/python-cell.el/issues/11

Regards, HZ



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-09-21 13:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-16 15:04 Show the figure created by matplotlib in Emacs' frame Hongyi Zhao
2021-09-16 18:45 ` Joost Kremers
2021-09-18 10:04 ` James Thomas
2021-09-18 11:41   ` Hongyi Zhao
2021-09-19 14:49   ` Hongyi Zhao
2021-09-21 12:51     ` Hongyi Zhao
2021-09-21 13:34       ` Hongyi Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).