how I can obtain the data points from a figure file?
1 view (last 30 days)
Show older comments
I know the answer when we have just one curve , but in my case they are two separate curve . So using this >> H = findobj(f, 'type', 'line'); >> x_data = get (H, 'xdata'); >> y_data = get (H, 'ydata'); give me all the y points together I want y points of each curve seperately.
0 Comments
Accepted Answer
Star Strider
on 9 Aug 2014
The H value should be a (2x1) vector. Each handle will give you the x and y data for each curve:
H = findobj(f, 'type','line')
x1data = get(H(1),'XData')
x2data = get(H(2),'XData')
y1data = get(H(1),'ydata')
y2data = get(H(2),'ydata')
3 Comments
Star Strider
on 10 Aug 2014
I don’t have your figure, so the best I can do is to simulate it with my own data. That worked for me.
Without your figure to work with, we can only guess what you want.
More Answers (0)
See Also
Categories
Find more on Graphics Object Properties 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!