Help with choice of contour intervals in surfc

5 visualizaciones (últimos 30 días)
Brantosaurus
Brantosaurus el 10 de Oct. de 2022
Respondida: Star Strider el 10 de Oct. de 2022
Is it possible to define a non-default contour plot interval in surfc like it is easily achieved in the contour-based range of plots?
For example how might i plot contours over z-intervals [-7:1:8] in the following:
Z = peaks(X,Y);
surfc(X,Y,Z)
colorbar

Respuesta aceptada

Star Strider
Star Strider el 10 de Oct. de 2022
The second object in surfc is the countour plot, so address it and set the 'LevelList' property —
[X,Y,Z] = peaks(50);
figure
hsc = surfc(X,Y,Z)
hsc =
2×1 graphics array: Surface Contour
colormap(turbo(50))
colorbar
hsc(2).LevelList = -7:8;
.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by