Plot two surfaces each with different color
24 次查看(过去 30 天)
显示 更早的评论
I want to plot a surface with green color on another surface with red color such that the grids will be transparent. How can I achieve this in Matlab?
0 个评论
采纳的回答
Star Strider
2018-4-4
I’m not certain what you want.
Try this:
[X,Y] = meshgrid(linspace(-2, 2, 50));
Z = @(x,y,c) x.^2 + y.^2 + c;
figure(1)
surf(X, Y, +Z(X,Y,-4), 'FaceColor','g', 'FaceAlpha',0.5, 'EdgeColor','none')
hold on
surf(X, Y, -Z(X,Y,-4), 'FaceColor','r', 'FaceAlpha',0.5, 'EdgeColor','none')
hold off
grid on
4 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Green 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!