I'm trying to maximize pt.show() on Mac. I'm using Python.
mac OS X ==10.10.3,
python==3.4.2
matplotlib==1.4.3
I have already tried the following:
mng.frame.Maximize(True)
mng.window.showMaximized()
mng.resize(*mng.window.maxsize())
mng.full_screen_toggle()
mng.window.state('zoomed')
from scipy import misc
import matplotlib.pyplot as plt
image = misc.lena()
plt.imshow(image)
mng = plt.get_current_fig_manager()
mng.frame.Maximize(True)
plt.show()
pyplot library. To change the figure size, use figsize argument and set the width and the height of the plot. Next, we define the data coordinates. To plot a bar chart, use the bar() function.
To show matplotlib graphs as full screen, we can use full_screen_toggle() method.
Plotting from a script If you are using Matplotlib from within a script, the function plt. show() is your friend. plt. show() starts an event loop, looks for all currently active figure objects, and opens one or more interactive windows that display your figure or figures.
I had the same issue and I simply used a different back-end than MacOSX one.
Try:
plt.switch_backend('Qt4Agg')
figM = plt.get_current_fig_manager()
figM.window.showMaximized()
You can also switch your backend in the default matplotlibrc file, but I prefer the above method for a quick workaround, as I use the MacOSX regularly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With