unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: James Thomas <jimjoe@gmx.net>
To: Augusto Stoffel <arstoffel@gmail.com>
Cc: 62783@debbugs.gnu.org
Subject: bug#62783: [PATCH] comint-mime: Add Matplotlib support in the standard interpreter
Date: Thu, 20 Apr 2023 10:47:58 +0530	[thread overview]
Message-ID: <875y9rdtdl.fsf@gmx.net> (raw)
In-Reply-To: <87y1ms5c5c.fsf@gmail.com> (Augusto Stoffel's message of "Sun, 16 Apr 2023 12:55:59 +0200")

Augusto Stoffel wrote:

> Also, it seems I also need to call plt.close() manually, otherwise
> subsequent calls to plt.plot add to the figure instead of starting a
> new one.

pyplot.show displays _all_ open 'figure's. If you want to display a
particular figure, fig.show() can be used. Also, pyplot.close can close
figures selectively.

Subsequent calls of pyplot.plot add to the 'current' figure which it
keeps track of (and that can be switched).

>   >>> plt.plot([1,2,1])
>   [<matplotlib.lines.Line2D object at 0x7ffb2cca0a10>]
>
> I still need to call plt.show() afterwards to see the image. This is
> better than nothing, but would be nice if the extra step wasn't
> necessary.

I guess it would be straightforward to implement a pretty-printer for
the Line2D object that would call its figure.show, but for the sake of
completeness this would have to be done also for every kind of element
in a figure other than lines - like axes or legends.

Also, personally, I would find it annoying if every change I make to a
figure would result in a redisplay. Sometimes I want to accumulate
changes before showing the result.

(I'm rather new to all this myself and the above is only to the best of
my knowledge)

--





  reply	other threads:[~2023-04-20  5:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-11 23:18 bug#62783: [PATCH] comint-mime: Add Matplotlib support in the standard interpreter James Thomas
2023-04-12  6:44 ` Augusto Stoffel
2023-04-12 10:32   ` James Thomas
2023-04-16 10:55     ` Augusto Stoffel
2023-04-20  5:17       ` James Thomas [this message]
2023-04-21 12:43         ` Augusto Stoffel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875y9rdtdl.fsf@gmx.net \
    --to=jimjoe@gmx.net \
    --cc=62783@debbugs.gnu.org \
    --cc=arstoffel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).