How can I change the tick labels in a colorbar
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Efstathios Kontolatis
am 10 Feb. 2017
Kommentiert: Efstathios Kontolatis
am 10 Feb. 2017
I have some images that contain probability data. Thus, the colorbar is [0 1]. However, when I plot them I want the colorbar tick labels to be [0% 100%](without changing the image). Is there a way to do so?
0 Kommentare
Akzeptierte Antwort
Adam
am 10 Feb. 2017
Bearbeitet: Adam
am 10 Feb. 2017
figure; hAxes = gca;
imagesc( hAxes, rand( 25 ) );
hc = colorbar( hAxes );
hc.TickLabels = arrayfun( @num2str, hc.Ticks * 100, 'UniformOutput', false );
3 Kommentare
Adam
am 10 Feb. 2017
hc.TickLabels = arrayfun( @(x) [num2str(x) '%'], hc.Ticks * 100, 'UniformOutput', false );
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Red 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!