Open .fig files for editing without having MatLab
Show older comments
I have a code that creates plots and save each plot as both a .fig file and a .jpg file. I then created a standalone desktop app that others can use to do some batch processing of data into graphs.
Is there a way they can open the .fig files with only having Runtime installed and not a full version of MatLab in case they need to make some changes to the plot (i.e. lines colors, sizes, etc.)?
Thanks!
Answers (2)
Walter Roberson
on 7 Dec 2022
0 votes
The interactive edit tools such as Property Inspector are not available in compiled executables.
You could write your own code that permitted them to manipulate the properties -- doing findobj() and injecting selection callbacks and similar. It might be a bit tedious.
5 Comments
Tyler
on 8 Dec 2022
Walter Roberson
on 8 Dec 2022
The plot inspector with property editor allows changing of callback properties. callbacks can contain arbitrary character vectors or function handles. So having the editor available would permit uses of compiled executables to write in arbitrary new code to be executed upon callback to the graphics objects. So it is not permitted.
Tyler
on 8 Dec 2022
Walter Roberson
on 8 Dec 2022
I was explaining why the usual tools are not available in compiled executables: because they would enable changes to the code.
I think Mathworks could have provided a tool that made those parts read-only, but they choose not to. I think they consider those tools more "development" and "debugging" rather than user interface.
Tyler
on 8 Dec 2022
Rik
on 8 Dec 2022
0 votes
You could try using GNU Octave to modify the fig file.
There are many downsides to using Octave instead of Matlab (I'm still planning to make a thread with a list some day), but for most cases it is free to use.
Not all code will work, and the apearance is a bit different, but usually simple things are plug and play. If a piece of code works in R2007b and in R2022b, you have almost 100% chance it will work in Octave.
2 Comments
Tyler
on 8 Dec 2022
Rik
on 9 Dec 2022
You can get my readfile function from the file exchange (I make sure all my submissions are compatible with Octave). It will automatically handle UTF-8 rich text if present and give you a cellstr (similar to how readlines will give you a string vector). I suspect you want to keep the header line and remove the following 6 lines, which is easy to do with indexing.
You're reading your data as a table. That specific data type doesn't exist in Octave (yet?), so you will have to use an alternative method to read your csv file. Luckily the dlmread function is implemented (and the csvread function, should you prefer it. You will have to change your code to use normal arrays instead.
You should also note that the Name=Value syntax is not supported in Octave (yet). This is a very recent addition in Matlab, so that isn't unexpected. You should also note that in Octave there isn't a difference between using double or single quotes, as they both produce char vectors. In Matlab a double quote will produce a string scalar.
Categories
Find more on Octave in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!