MATLAB Examples

Make Bubbles Smaller in Geographic Bubble Charts

This example shows how to reduce the size of the bubbles in a geographic bubble chart using the BubbleWidthRange property. (You can also reduce overlapping by resizing the geographic bubble chart figure.)

Read Lyme disease sample data into the workspace.

counties = readtable('counties.xlsx');

Create a geographic bubble chart using the latitude, longitude, and occurrence data from the table.

gb = geobubble(counties,'Latitude','Longitude','SizeVariable','Cases2010');

View the values of the SizeData and SizeLimits properties of the geographic bubble chart.

size_data_values = gb.SizeData;
size_data_values(1:15)
size_limits = gb.SizeLimits
ans =

   331
   187
    88
   125
   240
   340
   161
   148
    38
     4
   180
    19
    28
    89
    65


size_limits =

     0   514

Make the bubbles smaller to avoid overlapping using the BubbleWidthRange property. First view the initial setting of the property.

default_width_range = gb.BubbleWidthRange
gb.BubbleWidthRange = [4 15];
default_width_range =

     5    20