How do I create a colormap for a flat plane?

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
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?
Jossie
Jossie 2019년 9월 20일
ChangeDirectionOfColorTransitionsExample_03.png
Not necesarly this color scheme, but I want my flat plane to look something like this. Go from a dark color to a lighter one (without the grid). As I mention my plane is flat which does now allow me to variate the color.

댓글을 달려면 로그인하십시오.

 채택된 답변

Bjorn Gustavsson
Bjorn Gustavsson 2019년 9월 20일

0 개 추천

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개)

카테고리

도움말 센터File Exchange에서 Color and Styling에 대해 자세히 알아보기

질문:

2019년 9월 20일

댓글:

2019년 9월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by