Updated 20 Feb 2020
* * * The functions on this page are no longer being updated. They should still work as shown in the examples here, but I am only actively maintaining the versions of these functions which are in the Climate Data Toolbox for MATLAB, which can be found here https://www.mathworks.com/matlabcentral/fileexchange/70338. * * *
This submission contains functions to plot the outlines and names of National borders and US states. Matlab's Mapping Toolbox is NOT required.
There are two functions for plotting: borders and bordersm, and they both work the same way, except that bordersm is for use with maps created using Matlab's Mapping Toolbox. Similarly, labelborders and labelbordersm place text labels within the boundaries of countries or states.
Greene, Chad A., et al. “The Climate Data Toolbox for MATLAB.” Geochemistry, Geophysics, Geosystems, American Geophysical Union (AGU), July 2019, doi:10.1029/2019gc008392.
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
- Mathematics and Optimization > Mapping Toolbox > Map Display >
- Radar > Mapping Toolbox > Map Display >
- Sciences > Earth, Ocean, and Atmospheric Sciences > Climate Science and Analysis >
- Sciences > Earth, Ocean, and Atmospheric Sciences > Geodesy and Mapping >
Inspired by: WORLDDATAMAP, Google Earth Toolbox, zoharby/plot_google_map, land_or_ocean.m, landmask, strlookup
Inspired: EOF, patchsc, scattertextm, Automated importation of sea surface temperature data, Arctic Sea Ice
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Just adding a disclaimer that this version is no longer being maintained. Get CDT instead.
Updated live scripts
Added live scripts
Fixed a bug in bordersm, which previously resulted in an error when plotting multiple countries as patch objects.
Separated borders into two functions: Now, bordersm is the function to use with Matlab's Mapping Toolbox.
Now allows plotting national or state outlines as patch objects with or without the Mapping Toolbox.