How to draw equipotential lines on surface plot?
19 次查看(过去 30 天)
显示 更早的评论
I created a basic surface plot using meshgrid and a function d(x,y). My plot has a global minimum < -1 and a global maximum > 1. I want to draw three equipotential lines onto my surface plot, one where d(x,y) = -1, one where d(x,y) = 0 and one where d(x,y) = 1.
What is an easy and elegant way to do that? Thanks.
0 个评论
采纳的回答
Star Strider
2019-1-4
The code would go something like this:
X = [ ... ];
Y = [ ... ];
Z = [ ... ];
figure
surf(X, Y, Z)
hold on
contour3(X, Y, Z, [-1, 0, 1])
hold off
grid on
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!