Extracting y-data from ezplot.
2 次查看(过去 30 天)
显示 更早的评论
Dear everyone
I've created a plot using ezplot, and I want to extract the ydata. Now I have used the get(object,'YData'), but all I get are the y-axis values. I'm doing the following:
cd=ezplot('1.5*x.^.56*y.^.44=1', [0 6 0 6]);
And then something like:
y=get(cd,'YData');
But all I get is values from 0 to 6, not the shown y-values in the figure! In essence I need all the (x,y)-pairs in the interval (0 excluded)
Thanks in advance Patrick
1 个评论
kalpana
2013-8-12
I also want the x&y values of ezplot. how to get them? Please help us if you know.
采纳的回答
Friedrich
2013-8-12
编辑:Friedrich
2013-8-12
Hi,
you need to get the contourMatrix:
bla = ezplot('1.5*x.^.56*y.^.44=1', [0 6 0 6]);
tmp = get(bla,'contourMatrix');
figure
plot(tmp(1,:),tmp(2,:))
set(gca,'ylim',[0 6])
Small note: Don't name a variable, e.g. "cd" like a MATLAB function.
4 个评论
Friedrich
2013-8-14
编辑:Friedrich
2013-8-14
Hi,
I ran
bla = ezplot('1.5*x.^.56*y.^.44=1', [0 6 0 6]);
And then did a get(bla) to see what are the properties and what is stored in them. Since there aren't much properties which contain any numerical data it didn't took long to figure out that the data is stored under the contourMatrix property.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Performance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!