How to get the value of 'x' from a figure?
Show older comments
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
Answers (3)
Azzi Abdelmalek
on 12 Feb 2013
Click on your plot then type in command windows
x=get(gco,'xdata')
Depending on what you need, try
xlim
or
get(gca, 'XTick')
eduardoq
on 12 Feb 2013
0 votes
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!