On Tue, Jan 18, 2011 at 5:32 PM, Alex Liberzon <alex.liberzon@gmail.com> wrote:

While moving from Matlab to Numpy/Scipy/Matplotlib I need sometimes to work with Matlab figures. It would be nice if we could load Matlab figures in Python, extract the data and some basic parameters of how it was looking in Matlab and create its "clone" in matplotlib. At present the Matlab figures are MAT files and in the near future it will be HDF5, both formats are loadable. However, I have not found any reference for such attempts to load and parse the FIG files. As a beginner I find it difficult to write a large piece of code. However, if there are other  interested users that can cooperate on such, I'd gladly contribute some hours for this task. Meanwhile, to show the proof-of-concept attempt is attached below. All your useful comments and suggestions are very welcome.

Thank you,


That is very interesting.  I was not aware that matlab's figure files were simply .mat files in disguise.  I would presume that it would be feasible to produce some sort of importer in such a case (provided the documentation for Matlab's figure format is complete enough).

I am wary of making such a function a core feature of Matplotlib, however, because it would require creating a dependency to the scipy.io package.  However, I could see it being a toolkit package like Basemap.

Would you mind creating a feature request ticket at:


If you include this example code, and maybe some links to some documentation on matlab's figure files, maybe something can grow from that.

Ben Root