How can I change the size of the picture made with matplotlib
?
Without overwriting or creating anything new!
If you already have an image file, You can resize the canvas in the following ways:
import matplotlib.pyplot
fig = matplotlib.pyplot.gcf() #Bring into the current figure
Fig.set_size_inches (18.5, 10.5) #Size (in inches)
figure.savefig('test2png.png',dpi=100) #SaveCurrentFigure
set_size_inches(w, h, forward=False) changes the size of the figure in inches.
When set to forward=True
, the canvas size is automatically updated (reflected directly from the gui window you are using).
© 2024 OneMinuteCode. All rights reserved.