How to get the value of 'x' from a figure?
显示 更早的评论
Hello,
I'm trying to get the value of the x axis from a figure. I am currently using gtext, is there another way?
Cheers
回答(3 个)
Azzi Abdelmalek
2013-2-12
Click on your plot then type in command windows
x=get(gco,'xdata')
Depending on what you need, try
xlim
or
get(gca, 'XTick')
类别
在 帮助中心 和 File Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!