Filled 2D plot
Mostrar comentarios más antiguos
I have 3 vectors, X,Y,Z in which X,Y generates one plot and X,Z generates another. However, what I want to do is plot X,Y as a 2D plot and fill the area between the curve and the X axis with colors based on the Z values. I tried using the contour plot but failed. However, then I managed to change the colour of the curve based on the Z value as follows, but I need the complete area under the curve to be filled. Is there any advice?
c= cos(Z).^2;
colormap(hsv)
patch(X,Y,Z,c,'FaceColor','none','EdgeColor','interp')
2 comentarios
DGM
el 16 de Abr. de 2021
Please provide a sufficient amount of code to constitute an example of what you're trying to do.
Ironhide Jr
el 16 de Abr. de 2021
Editada: Ironhide Jr
el 16 de Abr. de 2021
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Surface and Mesh Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

