Discrete color scale in 3D plot
Ältere Kommentare anzeigen
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

Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Blue finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

