the unit will change from second to microsecond during zoom in

8 visualizaciones (últimos 30 días)
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!

Respuesta aceptada

Cam Salzberger
Cam Salzberger el 11 de Abr. de 2018
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

Más respuestas (0)

Categorías

Más información sobre Visual Exploration en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by