Change color of numbers at colorbar
27 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hey, is there a way to change the color of the written numbers at the colorbar? I don´t want to chance the colormap, just the color of the numbers at the color axis.
0 Kommentare
Akzeptierte Antwort
dpb
am 16 Jun. 2021
Undocumented property -- underneath is a NumericRuler object which does control the axes ticklabels independently.
figure
surf(rand(5))
colormap(turbo)
hcb = colorbar;
hcb.Ruler.Color='b';
yields
And, you can set
hcb.Color='r';
afterwards and not destroy the label colors but change the box outline only.
I've railed over and over about the penchant for hiding properties that TMW seems to get more and more enamored with...
5 Kommentare
Weitere Antworten (1)
Walter Roberson
am 16 Jun. 2021
surf(rand(5))
colormap(turbo)
hcb = colorbar;
hcb.Ruler.TickLabelFormat = '\\color{red}%g';
The double \\ is important for this purpose.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Colorbar finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!