I'm trying to learn how I can stretch the width of my plot both when showing (plt.show()
) it and saving (plt.savefig
) it.
More precisely, the plot has two y-axes that I have written as follows:
fig , ax1 = plt.subplots()
ax2 = ax1.twinx()
ax1.plot(x,y)
ax2.plot(x,y2)
plt.show()
Now the question is, how can I specify the size of the plot, e.g., how do we stretch the width/height?
When using plt.show()
and the plot appears, I can manually take one corner and resize the box however desired, but that manually customised size will not be the saved one.