Borrar filtros
Borrar filtros

How can I change the tick labels in a colorbar

1 visualización (últimos 30 días)
Efstathios Kontolatis
Efstathios Kontolatis el 10 de Feb. de 2017
Comentada: Efstathios Kontolatis el 10 de Feb. de 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?

Respuesta aceptada

Adam
Adam el 10 de Feb. de 2017
Editada: Adam el 10 de Feb. de 2017
figure; hAxes = gca;
imagesc( hAxes, rand( 25 ) );
hc = colorbar( hAxes );
hc.TickLabels = arrayfun( @num2str, hc.Ticks * 100, 'UniformOutput', false );
  3 comentarios
Adam
Adam el 10 de Feb. de 2017
hc.TickLabels = arrayfun( @(x) [num2str(x) '%'], hc.Ticks * 100, 'UniformOutput', false );
Efstathios Kontolatis
Efstathios Kontolatis el 10 de Feb. de 2017
Thank you very much that works fine

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Red en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by