Is there any program able to open .fig files saved by Matlab?
I recently noticed that octave will load a fig file as a structure, so if you're stuck with trying to open fig files without being able to access Matlab you could try and write an octave function that will load the fig file and reconstitute the plot from the contents of the struct .
How to open a FIG file. You can open FIG files in WinFIG, a cross-platform vector graphics editor application. To do so, select File → Open... from WinFIG's menu bar. Then, navigate to and open your FIG file.
Under Ubuntu, if you cannot add a custom command like this: Right click the . fig - file --> "Open with Other Application" --> Use a custom command --> matlab -desktop -r "open(%f)" one can use Ubuntu Tweak for that.
Update 29/04/2016
According to johnml1135's answer, fig files are essentially just mat files, and johnml1135 figured out where the various plot elements are stored, for converting a fig file to a Python plot.
Original
According to the answer here the fig file saved by Matlab is in a proprietary binary format. I don't know of any other software capable of loading this format.
Your best option is probably to have the figure saved as a pdf/png from within Matlab depending on the type of figure.
Possible workaround
I recently noticed that octave
will load a fig file as a structure, so if you're stuck with trying to open fig files without being able to access Matlab you could try and write an octave function that will load the fig file and reconstitute the plot from the contents of the struct
. This would probably require knowing prior information about the plot though.
As mentioned by @mutzmatron, .fig
is not easily opened, but this is mostly due to it being poorly documented (not sure about proprietary aspects...). As can be seen here, there is a simple format to them quite similar to .mat
files, which might give you another direction to go in.
I've always been quite fond of plot2svg. It exports Matlab figures (most anyway) to the non-proprietary vector format SVG.
Create a script (for example FigViewer.m) containing simply the command figure
and compile it by running
mcc -e -v FigViewer.m
from the Matlab command window. This way you get a platform-dependent application that runs on any computer with the right version of the Matlab Compiler Runtime installed, which is freely available. If you are looking for further information on the Matlab Compiler, use the MathWorks homepage instead of Google since some information is available only behind a login screen and thus cannot be found by Google.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With