How to reverse the order of bubble size in 'geobubble' function to represent 'bigger dots' for smaller data values and 'smaller dots' for bigger data values
2 views (last 30 days)
Show older comments
Hi,
I recently started using 'geobubble' function to plot data values at specific geographic locations described by Latitude and Longitude.
Is there a way to change the order of bubble size, where bigger dots represent smaller data values and smaller dots to represent bigger data values?
Code attached below:
counties = readtable('counties.xlsx');
gb = geobubble(counties,'Latitude','Longitude','SizeVariable','Cases2010');
geolimits(gb,[41 47],[-75 -66])
Thanks.
Answers (1)
Aymane ahajjam
on 18 Nov 2023
The documentation has the solution:
Reorder Bubble Colors
Change the color indicating high severity to be red rather than yellow. To change the color order, you can change the ordering of either the categories or the colors listed in the BubbleColorList property. For example, initially the categories are ordered Low-Medium-High. Use the reordercats function to change the categories to High-Medium-Low. The categories change in the color legend.
neworder = {'High','Medium','Low'};
gb.SourceTable.Severity = reordercats(gb.SourceTable.Severity,neworder);
0 Comments
See Also
Categories
Find more on Geographic Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!