1

I'm currently using the mpl library in python for my research project instead of my usual MATLAB. When it comes to using python for scientific purposes, I'm a complete noob, so assume I don't know anything.

Is there a way to save the matplotlib figures "interactively", so that I could send them to someone else, who can zoom in/out as they wish? AKA the equivalent of a .fig for MATLAB.

user3642365
  • 549
  • 1
  • 6
  • 16
  • Running a matplotlib.pyplot program opens a figure window that has a 'save the figure' button (second from right under the window title at the top).. Click on it to save the figure as a file. –  Aug 11 '15 at 18:23
  • What file format would be equivalent to a .fig? – user3642365 Aug 11 '15 at 18:29
  • The fig format used by matlab is propietary, so only Matlab can produce and read such files, I believe. Matplotlib, however, can export to a variety of formats, including png, jpg/jpeg and tif/tiff, which Matlab can read. – absay Aug 11 '15 at 18:43
  • 1
    @user3642365 - I closed this as it's a duplicate of the other question, at least at first glance (let me know if you disagree!). Basically, you can save and restore a figure through pickling, but don't expect it to work on someone else's system unless they're using the same matplotlib backend. You're better off sending your code and data rather than something analogous to a matlab .fig. – Joe Kington Aug 11 '15 at 19:05
  • I Concur - pickling is in effect very similar to the Matlab .fig format/functionality. Example: http://stackoverflow.com/questions/21538179/save-figure-parameters-after-interactive-tweaking/35100356#35100356 – Demis Jan 30 '16 at 10:05
  • Matlab .fig files have the exact same compatibility problems as a pickled file would - I've always had saved .fig files fail on other systems due to version or OS discrepancies. – Demis Jan 30 '16 at 10:07

0 Answers0