MATLAB: How change x axis data set to another on plot axes

axesMATLABplotxlabel

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?

Best Answer

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.