How to add a 2D line to a surf plot
186 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
parham kianian
am 17 Mär. 2020
Beantwortet: Walter Roberson
am 17 Mär. 2020
The following figure shows the x-y view of a surf plot. How can I add a 2D line to this type of plots. For example I have added a black curve to it using Window10 paint. I want to do this in MATLAB.
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 17 Mär. 2020
If you use pcolor() instead of surf() then it will give you the overhead view like that, and it will make all of the z values 0. That makes it easy to just plot() on top of the pcolor()
To plot a line on top of a surf() plot, you need to use plot3() specifying a z coordinate that is greater than any z coordinate of the data. If you accidentally use 0 as the z coordinate or use plot() instead of plot3(), then the line would be hidden behind any part of the surface that had a positive z value.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!