How can I change the tick labels in a colorbar
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Efstathios Kontolatis
le 10 Fév 2017
Commenté : Efstathios Kontolatis
le 10 Fév 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 commentaires
Réponse acceptée
Adam
le 10 Fév 2017
Modifié(e) : Adam
le 10 Fév 2017
figure; hAxes = gca;
imagesc( hAxes, rand( 25 ) );
hc = colorbar( hAxes );
hc.TickLabels = arrayfun( @num2str, hc.Ticks * 100, 'UniformOutput', false );
3 commentaires
Adam
le 10 Fév 2017
hc.TickLabels = arrayfun( @(x) [num2str(x) '%'], hc.Ticks * 100, 'UniformOutput', false );
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!