motam79
motam79

Reputation: 3824

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?

Upvotes: 2

Views: 542

Answers (1)

jpeg
jpeg

Reputation: 2461

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()

Upvotes: 4

Related Questions