0

I have made 2 bar plots, using ax1 and ax2. I am using matplotlib and pandas. I have imported the data from an Excel file.

My code currently looks something like this:

ax1 = df.plot.bar(x='Column name in excel', y='Column name in excel', Other specifications, such as color and width.
ax2 = Same as ax1, but different columns used from excel file. 

Then the next bit of my code is:

ax1.set_ylabel
ax1.set_xlabel
ax1.set_title

and so on. The same with ax2.

I have got 2 perfect plots and I am very happy with them. I just would like to have them next to each other horizontally as subplots, so I can export them as one image file and have a supertitle (suptitle) above both.

How can I do this? I have quite a lot of code and it would be a shame to have to start from scratch. Maybe there is a piece of code that does this and I could just add in below?

halfer
  • 19,824
  • 17
  • 99
  • 186
Scholar13
  • 1
  • 4
  • Adding a pandas tag in the question might help you to get better reach. – CuriousLearner Nov 11 '20 at 09:55
  • Does this answer your question? [pyplot - copy an axes content and show it in a new figure](https://stackoverflow.com/questions/45810557/pyplot-copy-an-axes-content-and-show-it-in-a-new-figure) – Mr. T Nov 12 '20 at 09:26

0 Answers0