projection of 3D plot onto 2D.
3 ビュー (過去 30 日間)
古いコメントを表示
Dear all,

Dear all,
Above is a 3D plot of a data and a line plot(white). The line plot starts from x=-0.2 and proceeds in a peicewise linear way up. However, as shown above, the lower part of this line is hidden. Possibly overshadowed by the 3D color graph.
My desired output is to show the full shape(or lenght) of the while line above the color map. Below is the code I used for the above plot.
figure(5);
clf
[xx,yy] = meshgrid(gridX,time_t);
HH = mesh(xx,yy,U);
view([0 90])
hold on
%for the white line
plot(xi_t,time_t, 'w', 'linewidth', 1.9);
ylabel('t')
xlabel('x')
colorbar
hold off
How do I solve this problem? Someone help me please. I have looked up and tried suggesstions on how to project a 3D figure onto 2D surface but to no avail.
THanks in advance
0 件のコメント
採用された回答
Star Strider
2019 年 10 月 6 日
You can change the transparency ('FaceAlpha') of the surf plot. The problem is that the line is white, so even with a very low 'FaceAlpha' value, it will not be visible. I would reduce the 'FaceAlpha' value, and make the line a colour that will contrast sufficiently with the surf plot to be visible beneath it.
Experiment with this:
[X,Y] = meshgrid(-1:0.01:1);
Z = X.^3 + sin(Y*2*pi);
figure
HH = surf(X, Y, Z);
HH.FaceAlpha = 0.3;
hold on
plot((1:20)/20, rand(1,20)*2-1, 'r', 'LineWidth',1.9)
hold off
shading('interp')
% view(0, 90)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Polygons についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!