File Exchange Pick of the Week

Our best user submissions

MATLAB Basemap Data (R2017b) 3

Posted by Jiro Doke,

Jiro‘s pick this week is MATLAB Basemap Data by MathWorks Mapping Team.

In the new R2017b release, there is a new interactive geographic function called geobubble which displays bubbles at geographic locations, with the size and color representing other parameters.

tsunamis = readtable('tsunamis.xlsx');
tsunamis.Cause = categorical(tsunamis.Cause);
gb = geobubble(tsunamis,'Latitude','Longitude', ...
    'SizeVariable','MaxHeight','ColorVariable','Cause')
gb = 
  GeographicBubbleChart with properties:

              Basemap: 'darkwater'
            MapLayout: 'normal'
          SourceTable: [162×20 table]
     LatitudeVariable: 'Latitude'
    LongitudeVariable: 'Longitude'
         SizeVariable: 'MaxHeight'
        ColorVariable: 'Cause'

  Use GET to show all properties

We can focus on a particular area, for example North America, with geolimits.

geolimits([10 65],[-180 -60])

The background image you see is the basemap. By default, the basemap you’re seeing here is called “darkwater” and is included with the product. You can change the Basemap property to five other maps: grayland, bluegreen, colorterrain, grayterrain, landcover. These maps are automatically accessed over the Internet. For those with no or low Internet connection, they can download an offline version of the maps.

grayland

gb.Basemap = 'grayland';
pause(2)

bluegreen

gb.Basemap = 'bluegreen';
pause(2)

colorterrain

gb.Basemap = 'colorterrain';
pause(2)

grayterrain

gb.Basemap = 'grayterrain';
pause(2)

landcover

gb.Basemap = 'landcover';
pause(2)

EDIT (to illustrate the exploratory nature of geobubble, as mentioned by Rob):

One of the use cases for geobubble is interactive exploration. For example, I can zoom in with my mouse to see a particular location in greater detail.

R2017b

There are plenty of new, great features in the new R2017b. Take a look at what’s new.

Comments

Give it a try and let us know what you think here or leave a comment for the MathWorks Mapping Team.


Get the MATLAB code

Published with MATLAB® R2017b

Note

Comments are closed.

3 CommentsOldest to Newest

Joanne Williams replied on : 1 of 3

This at first glance looks really useful, and I had a long comment I’ve just deleted whilst looking up the relative areas of Greenland and Africa… is this really only available for the Mercator projection? It’s a terrible choice for these purposes, and only used in geoscience if you absolutely have to preserve angle at all scales, (which is why google maps and spin-offs use it.) Try plotting a dot on the north/south pole!

Also these plots tend to distort the perception of the data by overlaying one set of dots on another. In the example here there are purple dots almost buried by the blue. It can be really dangerous if you’ve first sorted the data! A better approach is to merge neighbouring dots to create larger bubbles, and/or use transparency. Does this method provide that? Does it warn the user if dots are hidden? If not, what’s the advantage over a simple scatterplot? (Sorry I can’t test it properly as I’ve only got access to 2016b).

Oh, also if I was reviewing a paper I’d probably object to the 6 significant figure bubble size on the legend… a method of rounding there is required, like you would on a normal x-y axis label.

Rob Comer replied on : 2 of 3

Thank you for your feedback.
 
To answer your question about the projection, geobubble currently is limited to a Mercator projection. In Mercator projections like the one underlying geobubble, features closer to the poles do appear magnified relative to features closer to the equator. We chose the Mercator projection because of its suitability for interactive displays with multiresolution basemaps. That’s what underlies geobubble. You can’t see it from the static displays in the blog post, but the basemap is multiresolution and responds automatically when you zoom or pan, increasing in detail as the zoom level increases. The choice of projection helps enable this. 
 
To mitigate hiding, the bubbles are stacked by size (independently of how the inputs are sorted), with the largest on the bottom, and they are indeed semi-transparent. The interactivity of the map makes it easy to spread bubbles apart by increasing the zoom level. For example, you can place the cursor over a clump of bubbles, then rotate the scroll wheel on your mouse or swipe vertically on your trackpad to see the individual bubbles more clearly. Bubble merging could be useful, too, of course. 
 
By default, the bubble size legend limits match the extrema of your data. You can also set them manually — like this, for example: gb.SizeLimits = [0 600]. Setting the SizeLimits property is useful when constructing a map for publication, or if you need bubble size to have consistent meaning from one plot to another to facilitate visual comparison.