How do I create a colormap for a flat plane?
6 次查看(过去 30 天)
显示 更早的评论
I am creating a flat plane, I want the color of the plane to be a gradient. I tried using the colormap copper but it keeps it black because it is flat. How can I adjust the color?
[x,y] = meshgrid(1:1250,1:760);
z = zeros(size(x));
colormap('copper')
surf(x,y,z-1)
2 个评论
Geoff Hayes
2019-9-20
Jossie - what do you expect the output to look like? Can you us how you expect the gradient to be applied to your 2D data?
采纳的回答
Bjorn Gustavsson
2019-9-20
Use something like this:
surf(x,y,z-1,x+0.5*y),shading flat
You can use whichever linear combination of x and y to have your gradient in your desired direction.
HTH
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Colormaps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!