ipympl
ipympl copied to clipboard
Documentation: Flags to set notebook-wide default behavior
This is a continuation of the enhancement fixed with #134 . The fix in #134 allows hiding the figure headers by setting a figure-specific flag:
f = plt.figure()
f.canvas.header_visible = False
A further enhancement would be to not have to do this for every figure, but set the default behavior via a global flag, for example, something similar to mpl.rcParams
for ipympl. This could potentially be useful for other global behaviors of the package.
One thing I realized today is that you can actually do it, thanks to traitlets.
You can do:
from ipympl.backend_nbagg import Canvas
Canvas.header_visible.default_value = False
Perfect, thank you, that works!
Sure :) Let's keep your issue opened until this is properly documented somewhere
Just wanted to link this to #208.
Thanks, this really need to be done. I'll try to take some time to do it at some point.
You can do:
from ipympl.backend_nbagg import Canvas Canvas.header_visible.default_value = False
Any solution for Jupyter Lab as nbagg does not work there?
Any solution for Jupyter Lab as nbagg does not work there?
The quoted code will work in either jupyter lab or jupyter notebook. The name backend_nbagg
is a relic of where the ipympl
code came from
Nope...
Do I drop it at the wrong place??
huh - indeed that doesn't seem to work - I wonder if some update must've broken it along the way.
I suspect in this case that there is a conflict between the typescript defaults and the python defaults of these traits and somehow the typescript side is winning.
Is the notebook-wide flag going to be fixed for Jupyter Lab?