You can export the vectors xand ythe figure (provided that it is 2D-graphics for a single set of data):
h = plot(1:10);
xVec = get(h,'XData');
yVec = get(h,'YData');
If you do not have a handle, but the shape is open, you can use gcfit gcaas the handle of the current active shape or axis.
If you have several data sets (rows) in the figure, you can get all the associated data:
lines = findobj(h, 'Type', 'line');
nlines = length(lines);
points = cell(nlines,2);
for i = 1:nlines
points{i,1} = get(lines(i),'XData');
points{i,2} = get(lines(i),'YData');
end
source
share