the unit will change from second to microsecond during zoom in

조회 수: 5 (최근 30일)
bigseat
bigseat 2018년 4월 11일
답변: Cam Salzberger 2018년 4월 11일
In the Matlab plot, I want the unit to adapt when I zoom in or zoom out. For example, for a 1-second record, when I zoom in to microsecond scale, I would like the number at x-axis to be something like 2.5 µs rather than 25*1e-7. Of course I want to xlabel to be changed from 'second ' to 'microsecond'as wekk.
Thanks!

채택된 답변

Cam Salzberger
Cam Salzberger 2018년 4월 11일
Hello,
By default, MATLAB sticks to a consistent "unit" that matches with the data provided, since there is no other real way for MATLAB to know what units you are trying to use. Probably the easiest way to manage what you are looking for is to make a custom callback for a zoom action, and have that manage the tick locations, labels, and x-axis labeling. The ActionPostCallback is probably the one to use, since you can simply get the current limits of the axis to calculate desired tick labels.
-Cam

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Visual Exploration에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by