rgerum / pylustrator

Visualisations of data are at the core of every publication of scientific research results. They have to be as clear as possible to facilitate the communication of research. As data can have different formats and shapes, the visualisations often have to be adapted to reflect the data as well as possible. We developed Pylustrator, an interface to directly edit python generated matplotlib graphs to finalize them for publication. Therefore, subplots can be resized and dragged around by the mouse, text and annotations can be added. The changes can be saved to the initial plot file as python code.
GNU General Public License v3.0
707 stars 37 forks source link

`ImportError: cannot import name 'SubFigure' from 'matplotlib.figure`' #50

Closed trettelbach closed 2 years ago

trettelbach commented 2 years ago

When importing pylustrator (to run the _examplepylustrator.py script), I get the message ImportError: cannot import name 'SubFigure' from 'matplotlib.figure' and looking into the matplotlib.figure documentation, I cannot find any class named 'SubFigure', only 'Figure' or 'SubplotParams'. pylustrator is installed though.

Would appreciate any info on this. The tool looks so cool and I'd love to make it work on my machine :)

rgerum commented 2 years ago

Oh it seems that you use an older Matplotlib version where they did not yet have SubFigures. I should make the import of SubFigure optional so pylustrator works also with older Matplotlib versions.

rgerum commented 2 years ago

I wrote a fix and released a bugfix version of pylustrator. Your issue should now be solved when you upgrade pylustrator.

trettelbach commented 2 years ago

Awesome thanks for the quick fix! Works now and I am very amazed.