Axis Labels

2 次查看(过去 30 天)
Kathryn
Kathryn 2011-7-25
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?

回答(1 个)

Walter Roberson
Walter Roberson 2011-7-25
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.

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by