Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display a plot in fullscreen

i am trying to display a plot but in fullscreen. This is my code :

import numpy as np
import pylab as plt
a = np.array([1,2,3,4])
b = np.array([1,2,3,4])
plt.plot(a,b,'.')
plt.show()

But the problem is : this does not display with the fullscreen. Any ideas to solve this ? Thank you.

like image 205
Kenneth Metzger Avatar asked Feb 20 '17 21:02

Kenneth Metzger


People also ask

How do I view a full-screen graph in Excel?

To access this exploratory view, either double click on your graph’s header, or click on the full-screen button in the upper right-hand side of the graph. Full-screen graphs enable you to apply advanced functions such as anomaly detection to your graphs, without needing to build a new graph or clone an existing one.

Is it possible to plot on Fullscreen with MATLAB?

Is it possible to plot on fullscreen with MATLAB? I would like to use the entire screen, without window frame, menu, etc. Just a fullscreen plot area. Is it possible? Sign in to answer this question. It is possible to do this as of release R2018a using the WindowState property of a figure object.

How can I Make my plot bigger than full screen?

Not quite sure why you want to make your plot bigger than full-screen. You could set the x-lim and y-lim to zoom in on a certain section of your plot. Adjust your code to plt.show () plt.tight_layout () plt.savefig ('sampleFileName.png') to make the plot take up more of the maximized window.

How do I maximize a figure in full-screen mode?

Sign in to answer this question. Starting in MATLAB R2018a, you can use the WindowState property to maximize, minimize, or display a figure in full-screen mode. Please also see the related solution below for a method of programmatically maximizing, minimizing, and restoring a figure window.


2 Answers

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.

like image 60
Tairone Avatar answered Oct 25 '22 20:10

Tairone


If you also want to remove tool and status bar, with the full_screen_toggle mode you can prove:

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

manager = plt.get_current_fig_manager()
manager.full_screen_toggle()

Taken from http://matplotlib.1069221.n5.nabble.com/Image-full-screen-td47276.html

like image 37
Jhacson Avatar answered Oct 25 '22 21:10

Jhacson