how to determine the figure size of an open figure using the gui tool?
how to determine the figure size of an open figure using the gui tool?
Lets say I am plotting a pandas.DataFrame
df.plot(figsize = (10,10))
I usually start with the default figure size and adjust the figure size using the gui tool to achieve the format I want (making sure all legends look ok etc). However for the next plot, I don't want to repeat the same process. I would like to get the proper size and next time just call the plot with the hard-coded figure size that I got from tinkering with gui tool. Is there a way to get the current figure size from the gui?
1 Answer
1
Keep a reference to the plot axes:
ax = df.plot(figsize = (10,10))
You can then get the figure size later on using:
ax.get_figure().get_size_inches()
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.