1

I'm looking for a bit of finer control over the display of imshow in a Jupyter notebook.

Unlike %matplotlib inline (default) the magic command %matplotlib notebook causes imshow to add a toolbar below the figure, and this thing

matplotlib imshow titlebar

above the figure which I'm going to call the titlebar (it's a <div> element called dialog-titlebar).

Within one notebook I want to specifically control titlebar, toolbar and interactive pixel display on an imshow by imshow basis. I can use %matplotlib inline or %matplotlib notebook to turn all these things on or off, but I want something more nuanced (for teaching purposes I want to remove everything that's distracting or not relevant to the discussion).

Questions:

  1. Is there a way to turn off the figure toolbar programatically? If yes, does that include the pixel value display, or are they separately controllable? Is it possible to remove buttons, for imshow many of them are not relevant.
  2. Is there a way to turn off the interactive pixel display? I know I can use format_coord but that just stops the callback from displaying stuff, I want to turn off the call-back machinery for performance reasons.
Peter Corke
  • 544
  • 4
  • 16
  • I don't understand how `if`, "pixel value" and `format_coord` are related. Can you check if [this question](https://stackoverflow.com/questions/52620922/what-is-the-official-name-of-this-title-bar-from-matplotlib-how-to-hide-it/52622312) answers you rproblem, or at least it adapt it accordingly? – ImportanceOfBeingErnest Jan 16 '20 at 23:12
  • that question only provides static options to control these elements, magic commands or CSS code. I want programmatic control. – Peter Corke Jan 17 '20 at 00:52
  • I don't think I grasp what exactly needs to be programmatically controlled (on/off is a binary thing, so it's static, right?). But if the question can be updated to make that clearer, I can have another look. – ImportanceOfBeingErnest Jan 17 '20 at 01:14
  • question is updated and hopefully clarified – Peter Corke Jan 17 '20 at 05:01

0 Answers0