How can I display min and max in the colorbar?
147 views (last 30 days)
More Answers (1)
gwoo on 26 Oct 2018
You can also do the following and keep the automatically selected tick marks.
hColorbar = colorbar;
set(hColorbar, 'Ticks', sort([hColorbar.Limits, hColorbar.Ticks]))
This simply adds the limits to the tick labels and sorts them in order so they don't error out.
If you want them to be the same display precision (digits shown) as the others, you can do the typical:
round(0.00532 * 1000) / 1000
Obviously change the 1000 to whatever value you need to get whatever digit you need to round off to the one's place value for the rounding function. The /1000 gets it back in the original units.