Extract data points from a plot corresponding to the plot legend
Mostra commenti meno recenti
I am trying to determine how to extract the data file from the plot.
Data has to correspond with the correct plot. Please help.
open('ExampleData.fig')
Risposta accettata
Più risposte (1)
Here's one way:
f = openfig('ExampleData.fig');
lines = findall(f,'Type','line')
line_props = cell(1,numel(lines));
for ii = 1:numel(lines)
line_props{ii} = get(lines(ii));
end
line_props = [line_props{:}];
line_props
Now you can use line_props to get whatever information about the lines you need.
For example, to get the XData and YData of the '90°Post Thermal Dec' line:
idx = find(strcmp({line_props.DisplayName},'90°Post Thermal Dec'));
data = [line_props(idx).XData(:) line_props(idx).YData(:)]
Categorie
Scopri di più su Annotations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


