"figsize = " has different effect when plotting directly vs from dataframe

25 views
Skip to first unread message

Richard Stanton

unread,
Jul 22, 2015, 12:19:53 PM7/22/15
to PyData
Plotting using plt.plot, I often increase the default figure size somewhat using the command

plt.figure(figsize=(10,6))

Sometimes I plot using the built-in pandas plotting function, e.g.,

df.plot(figsize=(10,6))

Both of these commands work, and both increase the default figure size, but the figures don’t come out the same size in the two cases. To get them roughly the same size, in the pandas plot I need to set fig size to something like (8.5,5). Why the difference in behavior?

Paul Hobson

unread,
Jul 22, 2015, 12:31:59 PM7/22/15
to pyd...@googlegroups.com
This will be very difficult to diagnose without a complete, minimal, and working example that demonstrates the problem. Could you provide one?
-paul 

Richard Stanton

unread,
Jul 23, 2015, 7:30:22 PM7/23/15
to PyData
User error! I was using plt.tight_layout() in one case and not in the other.
Reply all
Reply to author
Forward
0 new messages