フィルターのクリア

setting limit for colormap

3 ビュー (過去 30 日間)
Giulia
Giulia 2023 年 4 月 27 日
回答済み: Simon Chan 2023 年 4 月 28 日
Hello,
I have this figure below and need to adjust the colorbar in a way that all horizontal gradient values below 0.05° are displayed in white. How do I do it?
Also need to show 0.05, 0.075, 0.1 degrees as contours instead of filled colours, but don't know how do it. Can anyone help?
Thanks in advance for your help!
PS couldn't attach the 'tdh' variable as it's too big. It represents horizontal sea surface temperatures gradients.
cm1 = brewermap(40,'RdPu');
cm1(cm1>1) = 1;
cm1(cm1<0) = 0;
LONLIMS=[-16 7.8];
LATLIMS=[47 62];
figure
m_proj('miller','lon',LONLIMS,'lat',LATLIMS);
m_pcolor(lont(1:end-1),latt(1:end-1),mean(tdh,3)')
shading flat
caxis([0 0.1])
colormap(cm1)
([0.05 1],:); % set your range here
colormap(cmap); % apply new colormap
colorbar();
m_grid('fontsize',10);
m_gshhs_f ('patch',[.8 .8 .8],'edgecolor',[.1 .1 .1]);
cb = colorbar;
cb.Label.String = 'Horizontal Temperature gradient (\circC)';
  2 件のコメント
Adam Danz
Adam Danz 2023 年 4 月 27 日
See clim.
Giulia
Giulia 2023 年 4 月 28 日
Thank you Adam.
Although clim changes the limit showing only values 0.05 to 0.1. I am looking to show values between 0 to 0.1, but to show values below 0.05 all white, so starting colour from 0.05, if that makes sense.

サインインしてコメントする。

回答 (1 件)

Simon Chan
Simon Chan 2023 年 4 月 28 日
You may try to create a custom colormap using colormapeditor.

カテゴリ

Help Center および File ExchangeColormaps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by