0

How can I rearrange my subplots where the plots don't overlap? Appreciate also if there are tips on how to increase the plot sizes :)

Here's my code:

fig = plt.figure()

ax1 = fig.add_subplot(311)
ax1.plot(df[['data1A','data1B','data1C']])
ax1.set_title('group1')

ax2 = fig.add_subplot(312)
ax2.plot(df[['data2A','data2B']])
ax2.set_title('group2')

ax3 = fig.add_subplot(313)
ax3.plot(df['data3A'])
ax3.set_title('group3')

enter image description here

Yel
  • 65
  • 6
  • 2
    Use plt.tight_layout() at the end – Sheldore Apr 03 '20 at 11:49
  • 2
    Does this answer your question? [How to use matplotlib tight layout with Figure?](https://stackoverflow.com/questions/9603230/how-to-use-matplotlib-tight-layout-with-figure) – Diziet Asahi Apr 03 '20 at 12:36
  • 1
    `fig.subplots_adjust(wspace=0.3, hspace=0.3) ` In this case, you only need to set the height, but for multiple graphs with multiple columns, you can also adjust the spacing between the graphs. – r-beginners Apr 03 '20 at 13:32

0 Answers0