How can I access the data used to create my plot from the FIG file?

1 view (last 30 days)
I would like to access the data that was used to create the plot in the attached FIG-file.
Is the data embedded in the file?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 26 Apr 2018
The figure in the attached FIG file contains a surface object and a series of line objects represented by "+" and "." markers. It is possible to access the 3D data used to create the surface object in the following manner :
m=open('filename.fig') %where filename is the FIG file
c=findobj('type','surface');
x=get(c);
The fields XData,YData and ZData of the structure "x" will now contain the data you require.
You may also access the data used to create the line objects in the following manner:
m=open('filename.fig')
c=findobj('type','line');
for ind=1:length(c)
lobj(ind)=get(c(ind));
end
Since there are many different line objects in this case, I accumulate each one of them into an array of structure.For example :
lobj(1).XData
will be the XData of the first line object and so on.
You may also access this data using the plot browser. To do this, open the figure by typing :
m=open('filename.fig')
Go to the View menu of the figure and select "Plot Browser". Go to the Desktop menu of the figure and select the "Property Editor". You may now click on any object in the Plot Browser and view its Properties in the Property Editor by clicking on more properties.

More Answers (0)

Categories

Find more on Visual Exploration in Help Center and File Exchange

Products


Release

R2006a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!