How to draw a picture in matlab as below:

4 visualizaciones (últimos 30 días)
希萌
希萌 el 6 de Jun. de 2023
Editada: Star Strider el 6 de Jun. de 2023
I have the data but I am required to draw a picture in the following style:
So I want to know how to put the two type of picture in one piece
Thank U!

Respuesta aceptada

Star Strider
Star Strider el 6 de Jun. de 2023
Editada: Star Strider el 6 de Jun. de 2023
That resembles a surfc plot. The contour normally only shows the contour llines, however setting the 'FaceColor' to 'flat' (from the default 'none') fills it appropriately.
Try something like this —
Z = peaks;
sc = surfc(Z, 'EdgeColor','interp');
ctr = sc(2);
ctr.FaceColor = 'flat';
zlim([-10 max(zlim)])
xlabel('$z$', 'Interpreter','latex')
ylabel('$\xi$', 'Interpreter','latex')
zlabel('error')
title('(c)error')
EDIT — Re-ran the code.
EDIT — (6 Jun 2023 at 13:04)
Added axis labels and title, changed zlim.
.

Más respuestas (0)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by