projection of 3D plot onto 2D.
3 views (last 30 days)
Show older comments
Kwame Atta Gyamfi
on 6 Oct 2019
Commented: Star Strider
on 6 Oct 2019
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 Comments
Accepted Answer
Star Strider
on 6 Oct 2019
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)
More Answers (0)
See Also
Categories
Find more on Polygons in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!