Skip to content
Advertisement

What is the official name of this title bar from matplotlib and how do I hide it?

I am new to matplotlib, and I don’t know what the name of the title bar arrowed in following image is.

Title bar

I googled and dug from matplotlib official documentation, but I didn’t get a clue.

What is the official name of this title bar from matplotlib, and how do I to hide it?

I don’t want to remove the interactivity; I just want to hide the bar, because when I interact with the plot, the title bar flex/Stretch rapidly, which is so boring and distracting

Advertisement

Answer

The title bar of the figure may be called dialog-titlebar judging from its name in the layout. It is a <div> element of the output’s DOM tree. To hide such elements, they may be given the display: none; property via CSS. Somewhere in your notebook you may state

%%html
<style>
div.ui-dialog-titlebar {display: none;}
</style>

enter image description here

See How do I set custom CSS for my IPython/IHaskell/Jupyter Notebook? for how to apply this potentially to any notebook by default.

An alternative is to not use the %matplotlib notebook backend, but %matplotlib widget instead. This is part of jupyter-matplotlib and currently needs to be installed separately as shown in the link. It’ll by default have no titlebar while still providing full interactivity. There is a looong term plan to have it replace the %matplotlib notebook backend – but “looong” has many “o”s here.

Advertisement