Borrar filtros
Borrar filtros

How to get the value of 'x' from a figure?

1 visualización (últimos 30 días)
eduardoq
eduardoq el 12 de Feb. de 2013
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

Respuestas (3)

Azzi Abdelmalek
Azzi Abdelmalek el 12 de Feb. de 2013
Click on your plot then type in command windows
x=get(gco,'xdata')

Thorsten
Thorsten el 12 de Feb. de 2013
Editada: Thorsten el 12 de Feb. de 2013
Depending on what you need, try
xlim
or
get(gca, 'XTick')

eduardoq
eduardoq el 12 de Feb. de 2013
Found it!
ggg=gtext('hhh');
click on the figure the coordinate you wish to know
get(ggg);
look into 'Position' and done
or simply click on tools in the figure window, data cursor and click the point you are trying to find the corrdinates

Categorías

Más información sobre Labels and Annotations en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by