Format colorbar using engineering notation
Show older comments
How can I set the scale of a color bar to use exponential notation, with all exponents being a multiple of 3?
I know that format shortEng will set the format I want for values printed to the Command Window, but I cannot find anything to format string printed elsewhere using this format.
Accepted Answer
More Answers (1)
Harry Dymond
on 3 Jul 2020
A little late for the OP perhaps, but:
- My num2eng FEX submission will process colorbars to update the tick labels, and keep them updated if the data in the associated axes change. Just pass the handle of the colorbar to num2eng.
- It sounds like, from your comment to Star Strider, that this isn't actually what you want. You want to have a "global" exponent for the colorbar, and for this to be a multiple of three. For this, you need to use the colorbar's hidden .Ruler.Exponent property. e.g.:
barH = colorbar; barH.Ruler.Exponent = 9;
Categories
Find more on Graphics Object Properties in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!