[matplotlib-devel] pyplot functions: do you rely on the "hold" kwarg?

Following up on this one more time, is there anyone who uses `hold` as an
integral part of your workflow?

We would like to remove this feature from the library entirely and are
trying to judge how fast we can do this.

Tom

···

On Sun, Jun 7, 2015 at 6:18 PM Eric Firing <efiring at hawaii.edu> wrote:

On 2015/06/07 12:05 PM, Nathaniel Smith wrote:
> On Sun, Jun 7, 2015 at 2:37 PM, Eric Firing <efiring at hawaii.edu> wrote:
>> Matplotlib's pyplot retains quite a few vestiges from its original
>> Matlab-workalike heritage; we would like to gradually eliminate those
>> that no longer make sense. One such candidate is the "hold" kwarg that
>> every pyplot function has, with a "True" default. I don't think it
>> serves any useful purpose now, and getting rid of it would allow
>> considerable simplification to the code and, to a lesser extent, the
>> documentation. The default behavior would not change, only the ability
>> to change that behavior via either the rcParams['axes.hold'] parameter
>> or the "hold" kwarg in a pyplot function call.
>>
>> If you routinely use 'hold=False' and believe that removing it would be
>> a mistake, please let us know.
>
> I do actually use it with some regularity interactively, though I'm
> not particularly attached to it. Is there some equivalent though, like
> plt.whatever(..., hold=False)
> can become
> plt.clear(); plt.whatever(...)

It's exactly equivalent to:
        plt.cla(); plt.whatever(...)

> ? The semantics would be that the current figure remains the current
> figure, but is reset so that the next operation starts from scratch. I
> notice that plt.clear() does not exist, but maybe it has another
> spelling :-).

There are two types of "clear":
        plt.clf() # clear the current Figure
        plt.cla() # clear the current Axes

Eric

>
> (Basically the use case here is getting something like the
> edit-and-rerun-a-cell workflow, but when using a classic interactive
> REPL rather than the ipython notebook -- so I have a specific plot
> window up on my screen at a size and place where I can see it, and
> maybe some other plots in other windows in the background somewhere,
> and I want to quickly display different things into that window.)
>
> -n
>

------------------------------------------------------------------------------
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users at lists.sourceforge.net
matplotlib-users List Signup and Options

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20150909/31f2d7b1/attachment.html&gt;