Reputation: 4651
I am trying to increase the size of the image resulting from this function:
plt.figure()); data_ordertotal.plot(); plt.legend(loc='best')
I tried this but the size remains the same
plt.figure(figsize=(40,40)); data_ordertotal.plot(); plt.legend(loc='best')
I am coding using spyder and the output in the console remains always the same size. Any solution? Thanks
Upvotes: 5
Views: 20180
Reputation: 21873
I guess you're using pandas, and you should use:
data_ordertotal.plot(figsize=(40,40))
It doesn't work with plt.figure(figsize=(40,40))
because pandas will create a new figure if you don't pass it an axe
object.
It would work with:
fig, ax = plt.subplots(1, 1, figsize=(40,40))
data_ordertotal.plot(ax=ax)
...Assuming you're using pandas, if not you should detail a bit more what is data_ordertotal
HTH
Upvotes: 18
Reputation: 1183
when you create a figure change the figsize. The dimension are in inches
import matplotlib.pyplot as plt
plt.figure(num=1, figsize=(40, 40), dpi=80, facecolor='w', edgecolor='k')
That works for me in spyder.
fig = plt.gcf()
fig.set_size_inches(18.5, 10.5)
should also work
Upvotes: 3