matplotlib / ipympl

Matplotlib Jupyter Integration
https://matplotlib.org/ipympl/
BSD 3-Clause "New" or "Revised" License
1.59k stars 225 forks source link

Ability to configure defaults for `Canvas` #540

Open FeldrinH opened 10 months ago

FeldrinH commented 10 months ago

As shown in the example notebook, it is possible to configure the appearance of the Canvas widget by setting some attributes on it. A lot of these attributes are settings that I would like to configure in the same way for all figures. It would be very convenint if there was some way to set the default values of these attributes before creating plots (similar to matplotlib.rcParams).

I tried changing the traitlet definitions directly (i.e. Canvas.header_visible.default_value = False), but apparently the traitlets cache the original default values somewhere and ignore the change to default_value.