How to display a plot in fullscreen

The code provided in the accepted answer will maximize the figure, but won't display it in fullscreen mode.

If you are keeping a reference to the figure, this is how you can toggle fullscreen mode:

import matplotlib.pyplot as plt

fig = plt.figure()
fig.canvas.manager.full_screen_toggle() # toggle fullscreen mode
fig.show()

alternatively, if you're not keeping a reference:

import matplotlib.pyplot as plt

plt.figure()
plt.get_current_fig_manager().full_screen_toggle() # toggle fullscreen mode
plt.show()

To toggle fullscreen mode using your keyboard, simply press f or Ctrl+f.


It is depend on your matplotlib backend. For Qt you may write this codeto maximize your plotting window:

manager = plt.get_current_fig_manager()
manager.window.showMaximized()

And read this question: Saving Matplotlib graphs to image as full screen