File Exchange

image thumbnail

extractFigData

version 1.0.0.0 (1.6 KB) by Damith Senaratne
Extracts XData & YData for each line given a Figure.

2 Downloads

Updated 12 Aug 2011

View License

Extracts XData & YData for each line given a Figure.

This method could be useful where old simulation results have been saved only as figures.

Accepts a handle to the figure. The current figure is chosen if no argument is passed in.

Outputs 'data' is a cell array whose each cell corresponds to a line (first row XData; second row YData), when only a single set of axes exists on the figure.

If there are multiple sets of axes present (e.g. as with subplots), a cell array containing a cell array as above per each set of axes would be output.

Cite As

Damith Senaratne (2021). extractFigData (https://www.mathworks.com/matlabcentral/fileexchange/32516-extractfigdata), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (1)

laurent jalabert

X = get(hl(k),'XData');
Y = get(hl(k),'YData');
err_Y = get(hl(k),'UData'); % in case of errorbar graph
temp{Nl-k+1} = [X;Y;err_Y]; % extract data for errorbar graph

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!