How change x axis data set to another on plot axes?

I have some plot where seconds on axis x set by data x1 = 1:7200; How I can change this vector on plot without it rebuild to another vector, for example x2 = x/3600?

 Respuesta aceptada

Jos (10584)
Jos (10584) el 25 de Feb. de 2016
if you have axes to the handle it is easy:
x = rand(10,1) ;
y = rand(size(x)) ;
ph = plot(x,y,'bo-') ; % ph is the graphics handle to the line object
title ('Hit Ctrl-C to break') ;
while 1
set(ph,'xdata', rand(size(x))) ;
pause
end
You can get the handle using the children property of the axes.

Más respuestas (0)

Categorías

Más información sobre Line Plots en Centro de ayuda y File Exchange.

Preguntada:

el 25 de Feb. de 2016

Comentada:

el 25 de Feb. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by