[Matplotlib-devel] Changing rcParams locally, on the fly

Benjamin Root ben.v.root at gmail.com
Mon Feb 29 12:33:28 EST 2016


I should also note, that it is possible to change the color cycle after an
axes is created (although, now it is called the prop_cycle), using
ax.set_prop_cycle(). Keep in mind that any plots that have already been
made are unaffected by changing the property cycle because they have
already had their properties assigned.

On Mon, Feb 29, 2016 at 12:31 PM, Benjamin Root <ben.v.root at gmail.com>
wrote:

> There is the context manager approach, but it must be utilized prior to
> axes creation. For the most part, any usage of the rcParams happen at
> creation time of the relevant artist. So, while you could update the color
> cycle prior to creating an axes but after the figure creation, changing the
> default figure size would be useless at that point since the figure is
> already made.
>
> There might be some push in the future to defer rcParam evaluation closer
> to draw time (traitlet integration), but I wouldn't bet on it happening any
> time soon, and it probably wouldn't do what you need in any case.
>
> Ben Root
>
>
> On Mon, Feb 29, 2016 at 12:03 PM, Phyks <spam+matplotlib at phyks.me> wrote:
>
>> Hi,
>>
>> Is there a way to change locally the rcParams, for a specific figure after
>> it has been created?
>>
>> I know about the rcParams setting (for global settings) and the with
>> statement construction, but this requires to be done before the figure was
>> created, and I need to change the settings on an already existing figure
>> (in
>> particular color cycler).
>>
>> Thanks
>>
>>
>>
>> --
>> View this message in context:
>> http://matplotlib.1069221.n5.nabble.com/Changing-rcParams-locally-on-the-fly-tp46813.html
>> Sent from the matplotlib - devel mailing list archive at Nabble.com.
>> _______________________________________________
>> Matplotlib-devel mailing list
>> Matplotlib-devel at python.org
>> https://mail.python.org/mailman/listinfo/matplotlib-devel
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20160229/c44e1500/attachment.html>


More information about the Matplotlib-devel mailing list