I'd like to plot bigger figure. As recommended in previous post I started with <fig = plt.figure(figsize=(20,10))> - nothing changed
Asked
Active
Viewed 5,894 times
-1
-
1Please note that screenshots of code are not permitted here, instead [edit] your question with the code as text. See [reprex] and [ask], thanks. – BigBen Aug 18 '21 at 13:46
-
@BigBen your advise is GRANTED! I'll write as the instructions. Thanks! – yankov.plamen Aug 18 '21 at 14:28
-
2 years are passed, we're still waiting it for XD – Alexey Nikonov May 13 '23 at 12:39
1 Answers
0
If you don't supply an existing Axes
object using the ax=
kwarg when you use df.plot
, pandas
will create a new figure, and plot on there, which is why it is ignoring your larger existing figure.
So, you could create and Axes
object and pass that in when you use df.plot
.
Instead of fig = plt.figure(figsize=(20, 10))
, try using:
fig, ax = plt.subplots(figsize=(20, 10))
...
df.plot(x='date', y='GVA', legend=True, color='g', ax=ax)
...

tmdavison
- 64,360
- 12
- 187
- 165
-
I'll mark this as accepted - it didn't resolve the plot but I will continue reading as the first suggestion and will try variation of your advise as well. – yankov.plamen Aug 18 '21 at 14:37