2

I want to show my graph fullscreen.

import numpy as np
import matplotlib.pyplot as plt

plt.rcParams['toolbar'] = 'None'

fig = plt.figure(frameon=False)
plt.show()

Shortcut 'f' works fine and I managed to get rid of the toolbar using rcParams. Is there an (easy) way to remove the status bar at the bottom of the figure, where the mouse position is displayed?

I'm grateful for any advice.

Area
  • 21
  • 1
  • 2
  • at least in `qt` it looks like the status bar is part of the underlying widget set. The answer will depend on backend, and you might need to do your own embedding to get what you want. – tacaswell Jul 10 '13 at 18:43
  • see: http://matplotlib.org/examples/user_interfaces/ – tacaswell Jul 10 '13 at 18:53
  • Thanks for the link. Using the 'embedding_in_tk' example and removing those lines that build the toolbar, I could remove the statusbar. Unfortunately the nice fullscreen functionality is gone too. But there seem to be solutions to that. [http://stackoverflow.com/questions/7966119/display-fullscreen-mode-on-tkinter] – Area Jul 11 '13 at 07:03
  • See https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/backends/backend_tkagg.py#L596 for how mpl implements the full screen functionality. – tacaswell Jul 11 '13 at 14:33
  • Good resource, thanks. – Area Jul 12 '13 at 05:53
  • You should write up what you did as an answer to your own question. – tacaswell Jul 12 '13 at 14:09

2 Answers2

4

To remove the whole toolbar (including status bar), you can hide it with

fig.canvas.toolbar.pack_forget()

And if you want to get it back, do something like this

fig.canvas.toolbar.pack(side=Tkinter.BOTTOM, fill=Tkinter.X)

Reminder: this applies when the TkAgg backend is used (which is the default).

Olivier
  • 393
  • 3
  • 11
1

This also works:

fig, ax = plt.subplots() 
plt.rcParams['toolbar'] = 'None' # Remove tool bar (upper bar)
fig.canvas.window().statusBar().setVisible(False) # Remove status bar (bottom bar)
Jhacson
  • 21
  • 1