Axis Labels

2 views (last 30 days)
Kathryn
Kathryn on 25 Jul 2011
I am using autoranges on my plots. The axis are shown in scientific notation with the multiplier shown once at the end of the axis (and to the side). Is there a way to continue using autoranges, but have the multiplier (ex x10^-3 or e-3) next to every tick label?

Answers (1)

Walter Roberson
Walter Roberson on 25 Jul 2011
Only by text()'ing the multiplier in to place, and being sure to have that logic hooked in to zoommode() so that the multiplier gets updated as you zoom or pan around.
There is an alternate approach, which is to set the [XY]TickLabel directly, to a tex string that includes the exponent in it. Having even a single [XY]TextLable turns off [XY]TextLabelMode, and with that mode turned off, it will never include the automatic exponent, leaving you to text() in the entire label yourself. Though again if you do this then you have to handle all the label updates in zoommode(), but at least you are saved from try to get nice pixel alighment in the add-on string representing the exponent.

Tags

Products

Community Treasure Hunt

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

Start Hunting!