Cambiare colore degli Stati con il tool Basemap

조회 수: 1 (최근 30일)
Alessandro Mura
Alessandro Mura 2021년 12월 10일
답변: AKennedy 2024년 6월 4일
"tsunamis" è il nome della variabile
tsunamis = readtable('file dati.xls');
gb = geobubble(tsunamis,'Latitudine','Longitudine','SizeVariable','Popolazione');
gb.Basemap = 'bluegreen';
% Ora scelgo i colori
% discretize(nomeVariabile.NomeColonnadiexcel, [range con cui confronta la colonna scelta, nell'esempio sotto ho 3 range: da 0 a 100000, da 100000 a 200000, da 200000 a 500000]
% 'categorical', {qui ci metti i nomi con cui vuoi categorizzare le informazioni in base ai range di sopra, sopra hai 3 range quindi anche qua devi avere 3 valori ecc.}
gb.SourceTable.Livelli = discretize(tsunamis.Popolazione,[0 100000 200000 500000 ],...
'categorical', {'Basso','Medio','Alto'});
gb.ColorVariable = 'Livelli';
% Qui vai a impostare la grandezza minima e massima per i pallini [grandezzaMinima, grandezzaMassima]
gb.BubbleWidthRange = [4 15];
default_width_range = gb.BubbleWidthRange;
  댓글 수: 3

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

답변 (1개)

AKennedy
AKennedy 2024년 6월 4일
Hi Alessandro,
My translation might be off, but from what I can understand, you would like to change the colour of the geobubbles in your figure. You can do so by opening up the "Figure" window and then navigating to the "Property Inspector". Here you can find (or search for) the option "Bubble Color List" which contains the RGB triplets for all the bubbles. You can tweak this to get the desired results.
Here are some links that could help:
Hope this helps.

태그

Community Treasure Hunt

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

Start Hunting!