Effacer les filtres
Effacer les filtres

How to use "hold", or similar function, with Geobubble?

3 vues (au cours des 30 derniers jours)
Xel Ch
Xel Ch le 23 Juil 2018
Hello, I am trying to use the function geobubble multiple times in the same code to allow for different colors and sizes of bubbles on my map. To do so, I am trying to put the statement "hold on" between runs of geobubble, but am given the error, "Using hold with geobubble is not supported."
Another way I tried to solve this was by setting the map to parent axes with the statement "AxesH = axes('NextPlot', 'add');" at the beginning of the code. But, this gave me the error, "GeographicBubbleChart cannot be a child of Axes."
I am using Matlab2018A if it makes a difference. Any tips or alternate ways to approach this would be greatly appreciated. Thank you.
for ii = 2017:2018
T = readtable('RealQuakes5.xls');
TT = T(T.Year == ii,:)
figure
AxesH = axes('NextPlot', 'add');
TT.MagnitudeCat = discretize(TT.Magnitude,-2:1:10,'categorical');
gb = geobubble(TT,2,3,'SizeVariable','Magnitude','ColorVariable','MagnitudeCat','Basemap','colorterrain','Parent', AxesH);
geolimits([36 50],[-82, -56])
gb.BubbleColorList = flipud(autumn(12));
default_width_range = gb.BubbleWidthRange;
gb.BubbleWidthRange = [1 20];
hold on
gb = geobubble(TT,2,3,'SizeVariable','Magnitude','ColorVariable','MagnitudeCat','Basemap','colorterrain','Parent', AxesH);
geolimits([36 50],[-82, -56])
gb.BubbleColorList = flipud(autumn(12));
default_width_range = gb.BubbleWidthRange;
gb.BubbleWidthRange = [1 20];
title(ii)
end
  2 commentaires
zhang bo
zhang bo le 18 Mar 2020
Modifié(e) : zhang bo le 19 Mar 2020
figure;
geoaxes('NextPlot','add');
geoplot(x1,y1);
geoscatter(x2,y2,V,C,'fill');
BN
BN le 1 Juin 2020
It's not working. This is my question too. Anybody knows the answer? I want plot a border around country

Connectez-vous pour commenter.

Réponses (1)

Mohammad Sami
Mohammad Sami le 1 Juin 2020
geobubble allows for size and color to be specified as variables. You can concatenate your data in one table, and use the size and color variables instead for your need.
geobubble(lat,lon,sizedata,colordata)

Catégories

En savoir plus sur Geographic Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by