Vector plot over a surface plot
5 ビュー (過去 30 日間)
古いコメントを表示
Dear experts,
How can I get a surface plot like below in which vectors will be shown on the surface plot.
Figure(1)
I have tried this way:
TT = hypot(qx, qy);
figure()
surf(x, y, TT);
xlim([-7 7]);
ylim([-5 5])
colormap jet
colorbar
view(2)
hold on
quiver(x1, y1, qx, qy, 'g'); % plot tangential traction over slip aera
xlabel('X-coordiante [mm]');
ylabel('Y-coordiante [mm]');
zlabel('MPa');
hold off
where, x and y are the coordinates in the X and Y direction and TT is a matrix. qx and qy are the x and y components of TT.
If I plot separately, I get the surface plot and vector plot as shown below figure 2 and 3. But if I plot in the same figure I don’t get a plot like figure 1, rather what I get same as below figure 2. I need expert’s help. Thanks.
Figure(2)
Figure (3)
0 件のコメント
採用された回答
KSSV
2020 年 2 月 19 日
TT = hypot(qx, qy);
figure()
pcolor(x, y, TT);
xlim([-7 7]);
ylim([-5 5])
colormap jet
colorbar
view(2)
hold on
quiver(x1, y1, qx, qy, 'g'); % plot tangential traction over slip aera
xlabel('X-coordiante [mm]');
ylabel('Y-coordiante [mm]');
zlabel('MPa');
hold off
Don't use surf. It is a 3D plot, when you use quiver the arrows will be plotted under the surf and you cannot see them. Use pcolor.
その他の回答 (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!