Discrete color scale in 3D plot
Mostrar comentarios más antiguos
The following code produces a strip in the middle of a flat base. How can I adjust the color bar so that I can use only one color to represent the data range [0 2), one color for (2 4], one color for (4 6], and so on? So the color on the strip will be discrete on each level, rather than a continuous transition.
img = zeros(101,101);
img(51,51) = 10;
% let's try discrete color scale
surf(img)
shading interp
colorbar
axis tight

Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Blue en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

