0

I would like to know if there is a way to combined several figures created with matplotlib in one unique figure.

Most of the existing topics are related to multiple plots within one figure. But here, I have several functions which all create one elaborated figure (not just a plot, the figure itself is a multiple plot with texts, title, legends,...)

So instead of just doing the layout of those several figures using a software like Word, is there a way to directly combined all my figures in one unique figure under python ?

Thank you in advance !

Esculape
  • 51
  • 5
  • I guess you're not completely understanding the concept of `figures` and `axes`. Have a look at this post, helped me a lot recently: http://pbpython.com/effective-matplotlib.html – mattmilten Jul 04 '17 at 10:58
  • Possible duplicate of [How to make several plots on a single page using matplotlib?](https://stackoverflow.com/questions/1358977/how-to-make-several-plots-on-a-single-page-using-matplotlib) – Thomas Kühn Jul 04 '17 at 11:44
  • 1
    Thanks @mattmilten ! Indeed, it is still a bit confusing ;) the link you provided is awesome ! morality : Always take the time to understand the basics before delving blindly into coding. – Esculape Jul 04 '17 at 12:39

2 Answers2

0

The concept of figure in matplotlib does not allow to have a figure inside a figure. The figure is the canvas for other artists, like axes. You may of course add as many axes to a figure as you like. So for example instead of one figure with 4 axes and another figure with 6 axes, you can create a figure with 10 axes.

A good choice may be to use the gridspec, as detailed on the respecive matplotlib page.

ImportanceOfBeingErnest
  • 321,279
  • 53
  • 665
  • 712
  • Thanks ! I think that answers my question. I should work with Axes and then combine those different axes in a single figure. – Esculape Jul 04 '17 at 12:36
0

After additional researches, it seems my problem has no easy solution within Matplotlib itself. Multiple figures layout needs external post-processing of plots.

For those having the same problem, here is an interesting link : Publication-quality figures with matplotlib and svgutils

Esculape
  • 51
  • 5