0

Overlapping subplot figures

enter image description here

Relevant Code

plt2287 = fig.add_subplot(661)
plt2287.plot(X_wavelength, y_2287)
plt2287.title.set_text(' 2287 ')

plt2092 = fig.add_subplot(662)
plt2092.plot(X_wavelength, y_2092)
plt2092.title.set_text(' 2092 ')

plt2287 = fig.add_subplot(661)
plt2287.plot(X_wavelength, y_2287)
plt2287.title.set_text(' 2287 ')

plt2092 = fig.add_subplot(662)
plt2092.plot(X_wavelength, y_2092)
plt2092.title.set_text(' 2092 ')

plt2146 = fig.add_subplot(667)
plt2146.plot(X_wavelength, y_2146)
plt2146.title.set_text(' 2146 ')

plt2424 = fig.add_subplot(668)
plt2424.plot(X_wavelength, y_2424)
plt2424.set_title(' 2424 ')

plt.show()

Is there something specific I'm missing? Why does this happen?

Different to adjusting subplots because I can't keep readjusting the values constantly. With over 32 Subplots it becomes very difficult. Also, why does this even happen? I tried using .set_title and 'title.set_text

Andre Fu
  • 400
  • 1
  • 4
  • 16
  • Possible duplicate of [Improve subplot size/spacing with many subplots in matplotlib](https://stackoverflow.com/questions/6541123/improve-subplot-size-spacing-with-many-subplots-in-matplotlib) – l'L'l Jul 01 '18 at 02:59
  • @l'L'l interesting, I have over 32 subplots so doing this per subplot would be a huge undertaking – Andre Fu Jul 01 '18 at 03:04
  • 1
    Did you try this method: https://stackoverflow.com/a/9827848/499581 (`plt.tight_layout`)? – l'L'l Jul 01 '18 at 03:12
  • @I'LI Nice, very cool! [Too wide now ](https://imgur.com/TY6HEv3) – Andre Fu Jul 01 '18 at 03:17
  • 1
    You can adjust the spacing like this `plt.tight_layout(pad=0.4, w_pad=0.5, h_pad=1.0)`... just play with the numbers until you get something more desirable. – l'L'l Jul 01 '18 at 03:20

1 Answers1

1

Using Xming as a backend bc of Windows Linux Subsystem.

Click the adjustment button at the top

enter image description here

And Click Tight layout, it auto formats everything!

S/O to @I'L'I provided some great & cool new tools for me to use!

Andre Fu
  • 400
  • 1
  • 4
  • 16