-2

I have a Python script using pandas and matplotlib that outputs 4 plots into individual PNG files. This part is fine. I would also like to make all 4 plots into a collage automatically - nothing fancy, just all 4 plots plotted next to each other is fine - and output that collage image as another (5th) PNG file. Is this possible?

dcacat
  • 182
  • 7

1 Answers1

1

You can use plt.subplots(). This allows you to add multiple plots to the same figure. You can configure the rows and columns to make a 2x2 grid or 4x1 or 1x4.

Another option, if you want more control of subplot size, is Matplotlib Gridspec.

benrussell80
  • 297
  • 4
  • 10