When working with images, it’s often convenient to hide the axis:
But for many images it would be more convenient to have
plt.rcParams['axis'] = 'off'
in the beginning of a script, especially in Jupyter notebook context.
Does this exist?
You may want to consider using
figimage instead (matplotlib.pyplot.figimage — Matplotlib 3.5.2 documentation) but that does not resample (so a 1kx1k image will make a 10inx10in figure at 100dpi).
Thanks for the suggestion, I’ve just tried
figimage, but that is a bit inconvenient to use.
Is there any other way to set the default behavior to
One idea is adding the three lines:
but this is not pretty, and I’d like to still call images with
In the python animation library manim there is a
set_default method that allows the following:
t = Text("Hello World")
c = Circle()
maybe there is something similar possible in Matplotlib for hiding axis?