Borrar filtros
Borrar filtros

How to set number of value ranges in colorbar?

43 visualizaciones (últimos 30 días)
Simson Hutagalung
Simson Hutagalung el 6 de Ag. de 2022
Respondida: Cris LaPierre el 6 de Ag. de 2022
Hello everyone, i wanna ask, how to set number of value ranges is equal with number of color grading in colorbar?
Color grading have 14 colors, but the value just 10. Thank you
  1 comentario
Walter Roberson
Walter Roberson el 6 de Ag. de 2022
I do not seem to be able to replicate that when I activate a colormap that I have set a specific size for.
cmap = flag(10);
colormap(cmap);
colorbar()

Iniciar sesión para comentar.

Respuestas (1)

Cris LaPierre
Cris LaPierre el 6 de Ag. de 2022
% Create data & plot
data = peaks(25);
contourf(data)
cmap = jet(14);
colormap(cmap);
% Specify tick locations in colorbar automatically
cl = clim;
ct = linspace(cl(1),cl(2),size(cmap,1)+1);
c=colorbar('Ticks',ct);

Categorías

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

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by