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

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

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


From: James Thomas
Subject: bug#62783: [PATCH] comint-mime: Add Matplotlib support in the standard interpreter
Date: Thu, 20 Apr 2023 10:47:58 +0530
User-agent: Gnus/5.13 (Gnus v5.13)

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 via email to

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