Colorbar from an array

6 Ansichten (letzte 30 Tage)
Diego Mauricio Beramendi Ortega
Beantwortet: Voss am 28 Jun. 2022
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!!!!

Akzeptierte Antwort

Voss
Voss am 28 Jun. 2022
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();

Weitere Antworten (0)

Kategorien

Mehr zu Orange finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by