Colorbar from an array

6 ビュー (過去 30 日間)
Diego Mauricio Beramendi Ortega
Diego Mauricio Beramendi Ortega 2022 年 6 月 28 日
回答済み: Voss 2022 年 6 月 28 日
Hi all,
I am plotting geotiff files that have only one band. To do so I followed the next suggestions: https://uk.mathworks.com/matlabcentral/answers/517443-how-i-can-view-this-tif-file?s_tid=prof_contriblnk
I would like to know how to get a colobar according the array I used in the color map. Bellow I show my code:
[A,R1] = geotiffread('MOD06_L2.A2018001.1500.CER.WGS84.RAMIS.tif');
A = uint16(A);
brown_color = [0.5 0.2 0.1];
t = linspace(0, 1, max(A,[],'all'))';
cmap = t.*brown_color + (1-t);
gs = geoshow(A, cmap, R1);
Thanks in advance!!!!

採用された回答

Voss
Voss 2022 年 6 月 28 日
unzip data.zip
[A,R1] = geotiffread('MOD06_L2.A2018001.1500.CER.WGS84.RAMIS.tif');
A = uint16(A);
brown_color = [0.5 0.2 0.1];
t = linspace(0, 1, max(A,[],'all'))';
cmap = t.*brown_color + (1-t);
gs = geoshow(A, cmap, R1);
caxis([1 size(cmap,1)]);
colormap(cmap);
colorbar();

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by