Can I change the axis scaling after plotting is done?

조회 수: 5 (최근 30일)
Micke Malmström
Micke Malmström 2011년 4월 26일
I have a function that plots a graph with time on the x-axis, sometimes I want to change the scaling from s to ms or whatever.
Can I somehow do that without plotting it again and multiplying everything by 1e3?

채택된 답변

Jan
Jan 2011년 4월 26일
You can modify the XData, the XTicks or the XTickLabels. The first method is most flexible, because it support zooming with correct tick marks:
t = linspace(0, 2*pi, 100);
LineH = plot(t, sin(t));
pause(1.0);
XData = get(LineH, 'XData');
set(LineH, 'XData', XData / 1000);

추가 답변 (1개)

Oleg Komarov
Oleg Komarov 2011년 4월 26일
Give a look at xlim and datetick

카테고리

Help CenterFile Exchange에서 Labels and Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by