How does surf map colormatrix

조회 수: 1 (최근 30일)
Qianyu
Qianyu 2012년 1월 19일
I know surf(x,y,z,c) will use matrix c to map color, but how does it work? since matrix c actually has the size of z, instead of size of z x 3 (that's what I thought first, for I thought you specified the RGB for each element of z), how does matlab map c to different color schemes? For example,
surf(x,y,z,c); colormap winter
So how does matlab find the corresponding color based on c?

채택된 답변

Walter Roberson
Walter Roberson 2012년 1월 19일
It uses the standard color mapping techniques: min value of c maps to the lowest entry in the color map, max value of c maps to the highest entry in the color map, everything in between maps linearly in to color map index numbers.
You can change properties to change the mapping strategy.
  댓글 수: 2
Qianyu
Qianyu 2012년 1월 20일
Thank you. Now it makes sense to me. So if I don't use c, then the values of z will be mapped the same way, right?
Walter Roberson
Walter Roberson 2012년 1월 20일
If you do not use c then z will be copied to the internal property that c would otherwise go in (CData) and then the mapping proceeds in exactly the same way.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Orange에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by