DataSets[Builtin][WorldMap] - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Statistics and Data Analysis : DataSets Package : Builtin : WorldMap : DataSets/Builtin/WorldMap/ChoroplethMap

DataSets[Builtin][WorldMap]

  

ChoroplethMap

  

create and display a plot for a WorldMap object

 

Calling Sequence

Parameters

Options

Description

Examples

References

Compatibility

Calling Sequence

ChoroplethMap(m,dataTable)

ChoroplethMap(m,dataTable,colorlist,options,plotopts)

ChoroplethMap(m,countries,data)

ChoroplethMap(m,countries,data,colorlist,options,plotopts)

ChoroplethMap(m,ref)

ChoroplethMap(m,ref,colorlist,options,plotopts)

Parameters

m

-

a WorldMap object

dataTable

-

a table, Matrix, Array, DataSeries, or DataFrame.

countries

-

a list or one-dimensional Array or Matrix of country identifiers in the form of country names, ISO 3166 two- or three-letter country codes, or top level internet domain country codes. These name types may be mixed, and can be formatted as strings or names.

data

-

a list or one-dimensional Array or Matrix consisting of a data item for each country in countries, arranged in the same order

ref

-

a DataSets[Builtin][Reference] object consisting of two columns

options

-

(optional) keyword options of the form option=value, where option can be colorlist, grid, markers, projection, transformdata, or watercolor 

plotopts

-

(optional) plot options

Options

• 

colorlist : a list of colors to be used for the gradient. If not provided, the default value is the first two colors of the currently selected palette.

• 

grid : truefalse; controls the display of a grid of so-called graticule lines: curves of constant latitude and curves of constant longitude. By default, grid is set to be false. If it is true, this command shows latitude and longitude curves both at intervals of 15 degrees.

• 

markers : sets the proportion of the range of data falls in each color range. For more details, see the plot gradient color schemes help page.

• 

projection : specifies the name of the supported map projection to use. The default projection is MillerCylindrical. See ListOfProjections for a complete list of supported map projections.

• 

transformdata : option can be used to apply a function to the data before it is colored. For more details, see the plot gradient color schemes help page.

• 

watercolor : color object, plot color, or a color string recognized by ColorTools; specifies the color of oceans and other bodies of water.

Description

• 

The ChoroplethMap command creates and displays a map plot for m, with countries colored according to the given set of data.

• 

If TimeSeries data is provided through a DataSets[Builtin][Reference] object, then an animation is created, with each point in time corresponding to one frame.

  

Note: In this case, the procedure may take a long time to run. Creating an animation with the Globe projection is particularly slow, and is not advised.

• 

Regions with the smallest data values are shaded with first color listed in colorlist, regions with the largest data values are shaded with the last color listed in colorlist, and the values in between transition through the other colors, in order, listed in colorlist.

• 

Regions with no data, or with data which is undefined, are highlighted in a light shade of grey.

• 

If a table is passed to ChoroplethMap, an index-entry pair corresponds to a country (the index) and its data (the entry).

• 

If an Array or Matrix is passed, the first column should contain country names, and the second should contain the corresponding data. The rtable must have exactly two columns.

• 

If a DataSeries or DataFrame is passed, it must have a single column. The row labels must be the country names and the column must hold the corresponding data.

• 

If a DataSets[Builtin][Reference] object is passed, the element names should correspond to the country names, and the data contained in the reference should be the corresponding data.

Examples

mDataSets:-Builtin:-WorldMap

mPLOT...A map of the worldprojection: MillerCylindrical

(1)

Highlight Australia, Brazil, Canada, Denmark, and Egypt.

Canada, with the central data value, is colored red, since red is the color in the center of the colorlist.

Brazil and Denmark (including Greenland) are colored with intermediate colors, in accordance with their data values.

ChoroplethMapm,Australia,Brazil,Canada,Denmark,Egypt,1,2,3,4,5,green,red,blue

Display an animation of population over time.

The transformdata option is used to apply the natural logarithm to the data is colored, so that the impact of outliers with very large or very small populations on the coloring is reduced.

Note that it will take some time for data to be loaded.

countriesDataSets:-Builtin:-ReferenceCountry:

popcountries..,Population:

DataSets:-Builtin:-WorldMap:-ChoroplethMapm,pop,red,yellow,transformdata=log

Display the coastline length of various countries, using a different projection and a different transformation: many countries have coastline length 0, so taking the logarithm would yield minus infinity. Instead, we add 1 to each coastline length before taking the logarithm.

coastlinescountries..,Coastline

coastlinesCountry (Name)CoastlineAfghanistan0Albania362.kmAlgeria998.km(182 more)

(2)

DataSets:-Builtin:-WorldMap:-ChoroplethMapm,coastlines,red,yellow,`=`transformdata,xlogx+1,projection=LambertAzimuthalEqualArea

References

  

ISO 3166 Country Codes, International Organization for Standardization.

Compatibility

• 

The DataSets[Builtin][WorldMap][ChoroplethMap] command was introduced in Maple 2017.

• 

For more information on Maple 2017 changes, see Updates in Maple 2017.

See Also

Example: Visualizing Custom Data on a Choropleth Map

WorldMap