Subject: Re: bug#62783: [PATCH] comint-mime: Add Matplotlib support in the standard interpreter

From: Augusto Stoffel <[email-masked]>
Date: Sun, 16 Apr 2023 12:55:59 +0200

On Wed, 12 Apr 2023 at 16:02, James Thomas wrote:

> Augusto Stoffel wrote:
>
>> Thanks, I will have a look at this soon.
>
> Please prefer this slightly modified patch. It makes it possible for
> users to switch backends at the beginning with matplotlib.use even if
> comint-mime is enabled.

Okay, I tested and it works for me, but I have a question: If I call
just call the plot function I get e.g

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

Do you know if the mechanics here can be refined?