Hello,
I am creating maps using pcolor with a colorbar using colors from white to yellow to light red for small to medium to large values, respectively. I am using caxis to request the limits of the colorbar, however when I have outliers (extreme large numbers) in my data I see that my map now has dark red, black or gray colors where those extreme values are instead of the light red color I defined for large values. How could I force the extreme values of my data to have the light red color that I defined for my colorbar and skip those unwanted colors in my map?
Thanks!

댓글 수: 4

dpb
dpb 2018년 11월 17일
Set the colormap range first with the C array to pcolor; then colorbar().
"pcolor(C) uses the values in C to define the vertex colors by scaling the values to map to the full range of the colormap." so if you define it first to be the range desired, the values will be mapped accordingly. If, otoh, you draw the colorbar first, then map the data to that range, then the scaling will be to whatever the color map was for it.
Robert
Robert 2018년 11월 17일
Thank you, db!
I am defining C before colorbar. But I believe my problem is related to the fact that pcolor do not use the last row and column of C, which relate to my extreme values. Do you know if is a go-around solution to this?
dpb
dpb 2018년 11월 17일
Ummm...I thunk based on doc that the extremes of the values passed to pcolor were mapped to that range so there wouldn't be any values beyond there...
Can you post a code snippet and data that illustrates your problem for folks to poke at? Attaching .mat file is probably most compact/convenient way to provide the data.
Robert
Robert 2018년 11월 18일
Thank you so much dpb. I found a solution to my problem by using contourf, which allow me to have extreme data values as part of the maps colors.

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

답변 (0개)

카테고리

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

질문:

2018년 11월 17일

댓글:

2018년 11월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by