Is there a way to disable/hide matplotlib Toolbar that shows up on the bottom?
I'd tried something like this:
import matplotlib as mpl
mpl.rcParams['toolbar'] = 'None'
but unfortunately that didn't work.
Make sure to call mpl.rcParams['toolbar'] = 'None'
before you instantiate any figures.
If you are in Jupyter using %matplotlib widget
(ipympl) you can do:
fig.canvas.toolbar_visible = False
You can also disable header and footer with:
fig.canvas.header_visible = False
fig.canvas.footer_visible = False
Alternatively, you can hide the toolbar:
QToolBar.hide()
or
QToolBar.setVisible(False)
Obviously this will only work with a Qt backend. To expand on this answer, given the figure fig:
First, if using Qt5:
from PyQt5 import QtWidgets
Otherwise:
from PyQt4 import QtGui as QtWidgets
Then:
try:
win = fig.canvas.manager.window
except AttributeError:
win = fig.canvas.window()
toolbar = win.findChild(QtWidgets.QToolBar)
toolbar.setVisible(False)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With