필터 지우기
필터 지우기

Periodic hsv surf color

조회 수: 6 (최근 30일)
Gabri
Gabri 2018년 6월 8일
댓글: Image Analyst 2018년 6월 9일
Is it possible to set hsv colormap in order to get a periodic changing color? The hsv that I'm using right now starts from red, then pink, blue, green yellow and red again while I would like to have a periodic repetition of colors, something like red, pink, blue, green, yellow, green, blue, pink, red.
This is particularly helpful when you try to plot angles. In my case for example I plot (using surf 2d) a field's angle that goes from -pi to pi but using hsv colormap I see a color jump between -pi and pi even if they represent the same amount.

채택된 답변

Image Analyst
Image Analyst 2018년 6월 8일
hsv() is a built-in colormap. I suggest you don't change it. However you can build your own colormap that can have unique colors, colors in a gradient, or ranges of colors that repeat. See attached demo.
  댓글 수: 2
Gabri
Gabri 2018년 6월 8일
Is there a tool similar to colormapeditor that generates automatically the new colormap giving me the correspondent code?
Image Analyst
Image Analyst 2018년 6월 9일
There are lots of functions that generate colormaps, like hsv(), jet(), summer(), winter(), etc. Or you can invent your own. Then you can use the N by 3 array to set the axes's colormap, or you can use it to replace the default color order like my demo did.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by