GeographicBubbleChart Properties
Standalone geographic bubble chart appearance and behavior
GeographicBubbleChart
properties control the appearance and
behavior of a GeographicBubbleChart
object. By changing property
values, you can modify certain aspects of the chart. Use dot notation to query and set
properties.
gb = geobubble(1:10,1:10); v = gb.GridVisible; gb.GridVisible = "off";
Bubble Location
LatitudeData
— Latitude coordinates in degrees
vector with elements in range [–90, 90] | []
Latitude coordinates in degrees, specified as a vector with elements in
the range [–90, 90] or as an empty array ([]
). The vector
can contain NaN
values. The sizes of
LatitudeData
and LongitudeData
must match.
In most cases, the latitude limits of the chart do not extend outside of
the range [–85, 85] degrees. The latitude limits can extend outside of this
range when you set the MapCenter
and
ZoomLevel
properties the chart. For more
information, see Interact with Geographic Axes.
Data Types: single
| double
LatitudeVariable
— Table variable containing latitude coordinates
string scalar | character vector | pattern | numeric scalar | logical vector | vartype()
Table variable containing the latitude coordinates, specified using one of these indexing schemes.
Indexing Scheme | Examples |
---|---|
Variable name:
|
|
Variable index:
|
|
Variable type:
|
|
Regardless of the variable name, the axis label on the plot is always
Latitude
.
The variable you specify must contain numeric data of type
single
or double
. The data must be
in the range [–90, 90].
When you set this property MATLAB® updates the LatitudeData
property and
sets the LatitudeData
property to read-only.
LongitudeData
— Longitude coordinates in degrees
vector | []
Longitude coordinates in degrees, specified as a vector or as an empty
array ([]
). The vector can contain NaN
values. The sizes of LatitudeData
and
LongitudeData
must match.
Data Types: single
| double
LongitudeVariable
— Table variable containing longitude coordinates
string scalar | character vector | pattern | numeric scalar | logical vector | vartype()
Table variable containing the longitude coordinates, specified using one of these indexing schemes.
Indexing Scheme | Examples |
---|---|
Variable name:
|
|
Variable index:
|
|
Variable type:
|
|
Regardless of the variable name, the axis label on the plot is always
Longitude
.
The variables you specify must contain numeric data of type
single
or double
.
When you set this property MATLAB updates the LongitudeData
property and
sets the LongitudeData
property to read-only.
Bubble Size
BubbleWidthRange
— Minimum and maximum bubble diameters
[5 20]
(default) | positive scalar | 1-by-2 vector of positive numbers
Minimum and maximum bubble diameters, specified as a positive scalar or as a 1-by-2 vector of positive numbers, where the second number is greater than the first. Specify a scalar when you want all the bubbles to have the same size. Specify the bubble diameters in points, where one point equals 1/72 of an inch. Values must be in the range [1, 100].
SizeData
— Relative bubble sizes
[]
(default) | scalar | vector
Relative bubble sizes, specified in one of these forms:
Scalar — Use the same size for all the bubbles.
Vector — Use a different size for each bubble. Specify
SizeData
as a vector the same length asLatitudeData
.
SizeData
can contain NaN
values.
SizeLimits
— Size limits
1-by-2 vector
Size limits, specified as a 1-by-2 vector of non-descending values or as
an empty array ([]
). This property determines how size
data values map to the bubble widths, where:
The first element specifies the size data value that maps to the smallest bubble.
The second element specifies the size data value that maps to the largest bubble.
To create bubbles that are all the same size, specify the same value for each element.
For more information about controlling the sizes of bubbles, see Control Bubbles in Standalone Geographic Bubble Charts.
SizeVariable
— Table variable containing bubble size data
table variable index
Table variable containing the bubble size data, specified using one of these indexing schemes.
Indexing Scheme | Examples |
---|---|
Variable name:
|
|
Variable index:
|
|
Variable type:
|
|
The variable you specify can contain any numeric type. When you set the SizeVariable
property,
MATLAB updates the SizeData
property.
Bubble Color
BubbleColorList
— List of bubble colors
three-column matrix of RGB triplets | color name | short name | vector of string scalars | cell array of character vectors
List of bubble colors, specified using one of these forms:
A three-column matrix of RGB triplets whose elements specify the intensities of the red, green, and blue components of the color. A convenient way to generate a three-column matrix of RGB triplets is to use a predefined colormap such as
turbo
or to return the colors of a predefined color palette by using theorderedcolors
function.A color name such as
"red"
,"green"
, or"blue"
.A short name such as
"r"
,"g"
, or"b"
.A vector of string scalars that indicate color names or short names, such as
["red","green","blue"]
or["r","g","b"]
.A cell array of character vectors that indicate color names or short names, such as
{'red','green','blue'}
or{'r','g','b'}
.
By default, the bubble chart selects colors from an ordered list of 7
standard colors. If the number of categories specified by
ColorData
is greater than 7, the bubble chart
cyclically repeats the colors.
Data Types: cell
| string
| double
ColorData
— Data controlling bubble color
categorical vector | []
Data that controls the bubble colors, specified as a categorical vector or
as an empty array ([]
). The geographic bubble chart
assigns a color to each category using the colors stored in the
BubbleColorList
property. Bubbles associated with
the same category have the same color on the map.
The size of ColorData
must match the size of
LatitudeData
, except when you specify an empty
array.
Geographic bubble charts display the category values in the color legend. The color legend can display unexpected formatting when the values contain TeX markup characters, for example underscores.
To use a TeX markup character in regular text, edit the name of the category by using the
renamecats
function, and then insert the TeX escape character (\
) before the character you want to include.MATLAB supports a subset of TeX markup for the text displayed in legends. For more information about using TeX markup, see Greek Letters and Special Characters in Chart Text.
Data Types: categorical
ColorVariable
— Table variable containing bubble color data
table variable index
Table variable containing the bubble color data, specified using one of these indexing schemes.
Indexing Scheme | Examples |
---|---|
Variable name:
|
|
Variable index:
|
|
Variable type:
|
|
The variable you specify must contain categorical values. When you set the ColorVariable
property,
MATLAB updates the ColorData
property.
Labels
Title
— Title of geographic bubble chart
''
(default) | character vector | cell array of character vectors | string scalar | string array | numeric value | categorical
value
Title of the geographic bubble chart, specified as a character vector, a
cell array of character vectors, a string scalar, a string array, a numeric
value, or a categorical
value. When you specify this
property using a categorical
array, MATLAB uses the values in the array, not the categories.
Alternatively, you can add a title by using the title
function.
ColorLegendTitle
— Title of color legend
''
(default) | character vector | cell array of character vectors | string scalar | string array | numeric value | categorical
value
Title of the color legend, specified as a character vector, a cell array
of character vectors, a string scalar, a string array, a numeric value, or a
categorical
value. When you specify this property using
a categorical
array, MATLAB uses the values in the array, not the categories.
SizeLegendTitle
— Title of size legend
''
(default) | character vector | cell array of character vectors | string scalar | string array | numeric value | categorical
value
Title of the size legend, specified as a character vector, a cell array of
character vectors, a string scalar, a string array, a numeric value, or a
categorical
value. When you specify this property using
a categorical
array, MATLAB uses the values in the array, not the categories.
LegendVisible
— Visibility of size and color legends
'on'
(default) | 'off'
| true
| false
Visibility of the size and color legends, specified as
'on'
or 'off'
or the logical
values 1
(true
) or
0
(false
).
Alternatively, you can toggle the visibility of the legends by using the
legend
function.
Data Types: char
| string
| logical
Font
FontName
— Font name
supported font name | "FixedWidth"
Font name, specified as a supported font name or "FixedWidth"
. To display
and print text properly, you must choose a font that your system supports. The default
font depends on your operating system and locale.
To use a fixed-width font that looks good in any locale, use "FixedWidth"
.
The fixed-width font relies on the root FixedWidthFontName
property. Setting the root FixedWidthFontName
property causes an
immediate update of the display to use the new font.
FontSize
— Font size used in geographic bubble chart
positive scalar
Font size used in the geographic bubble chart, specified as positive scalar. The default font size depends on the specific operating system and locale. The geographic bubble chart measures the font size in points, where one point equals 1/72 of an inch.
Map
Basemap
— Map on which to plot data
'streets-light'
(default) | 'streets-dark'
| 'streets'
| 'satellite'
| 'topographic'
| ...
Map on which to plot data, specified as one of the values listed in the table. Six of the basemaps are tiled data sets created using Natural Earth. Five of the basemaps are high-zoom-level maps hosted by Esri®.
|
Map designed to provide geographic context while highlighting user data on a light background. Hosted by Esri. |
|
Map designed to provide geographic context while highlighting user data on a dark background. Hosted by Esri. |
|
General-purpose road map that emphasizes accurate, legible styling of roads and transit networks. Hosted by Esri. |
|
Full global basemap composed of high-resolution satellite imagery. Hosted by Esri. |
|
General-purpose map with styling to depict topographic features. Hosted by Esri. |
|
Map that combines satellite-derived land cover data, shaded relief, and ocean-bottom relief. The light, natural palette is suitable for thematic and reference maps. Created using Natural Earth. |
|
Shaded relief map blended with a land cover palette. Humid lowlands are green and arid lowlands are brown. Created using Natural Earth. |
|
Terrain map in shades of gray. Shaded relief emphasizes both high mountains and micro-terrain found in lowlands. Created using Natural Earth. |
|
Two-tone, land-ocean map with light green land areas and light blue water areas. Created using Natural Earth. |
|
Two-tone, land-ocean map with gray land areas and white water areas. Created using Natural Earth. |
|
Two-tone, land-ocean map with light gray land areas and dark gray water areas. This basemap is installed with MATLAB. Created using Natural Earth. |
Blank background that plots your data with a latitude-longitude grid, ticks, and labels. |
All basemaps except 'darkwater'
require Internet access. The
'darkwater'
basemap is included with MATLAB.
If you do not have consistent access to the Internet, you can download the basemaps created using Natural Earth onto your local system by using the Add-On Explorer. The five high-zoom-level maps are not available for download. For more about downloading basemaps and changing the default basemap on your local system, see Access Basemaps for Geographic Axes and Charts.
The basemaps hosted by Esri update periodically. As a result, you might see differences in your visualizations over time.
Alignment of boundaries and region labels are a presentation of the feature provided by the data vendors and do not imply endorsement by MathWorks®.
Data Types: char
| string
SourceTable
— Source table
table | timetable
Source table containing the data to plot. Specify this property as a table or a timetable.
GridVisible
— Visibility of grid lines
'on'
(default) | 'off'
| true
| false
Visibility of the grid lines, specified as 'on'
or
'off'
, or the logical values 1
(true
) or 0
(false
).
Alternatively, you can toggle the visibility of the grid lines by using
the grid
function.
Data Types: logical
| char
| string
LatitudeLimits
— Latitude limits of map
two-element vector
This property is read-only.
Latitude limits of the map, returned as a two-element vector of the form
[latmin latmax]
. Each element is in the range [–90,
90] degrees.
Change the latitude limits by using the geolimits
function.
The latitude limits do not change when you resize the chart by resizing the window, except to adapt to changes in the aspect ratio of the map.
Example: [-85 85]
Data Types: double
LongitudeLimits
— Longitude limits of map
two-element vector
This property is read-only.
Longitude limits of map, returned as a two-element vector of the form
[lonmin lonmax]
.
Change the longitude limits by using the geolimits
function.
The longitude limits do not change when you resize the chart by resizing the window, except to adapt to changes in the aspect ratio of the map.
Example: [-100 100]
Data Types: double
MapCenter
— Center point of map
two-element numeric vector
Center point of the map, specified as a two-element numeric vector of the
form [center_latitude center_longitude]
, where
center_latitude
is the latitude in degrees and
center_longitude
is the longitude in degrees. The
latitude value must be in the range (–90, 90).
Data Types: single
| double
MapLayout
— Layout of map
'normal'
(default) | 'maximized'
Layout of the map, including the insets and decorations, specified as
'normal'
or 'maximized'
.
Value | Description | Illustration |
---|---|---|
'normal' | Map is inset from the edges of the chart, as defined by its
OuterPosition property. The axes labels, ticks,
and tick labels are visible. The title is visible, when specified.
Legends, when present, appear outside and to the right of the
map. |
|
'maximized' | Map fills the entire space, as defined by the
OuterPosition property. The axes labels, ticks,
and tick labels are hidden. The title is hidden, even when specified.
The grid is hidden, even when the GridVisible
property has a value of 'on' . Legends, when present,
appear within the map, toward the upper-right corner. |
|
Data Types: char
| string
ScalebarVisible
— Visibility of scale bar
'on'
(default) | 'off'
| true
| false
Visibility of the scale bar on the map, specified as
'on'
or 'off'
, or the logical
values 1
(true
) or
0
(false
).
Data Types: logical
| char
| string
ZoomLevel
— Zoom level
numeric scalar in range [0, 25]
Zoom level of the map, specified as a numeric scalar in the range [0, 25].
The value is a base 2 logarithmic map scale. Increasing the
ZoomLevel
value by 1 doubles the map scale.
Data Types: single
| double
Position
PositionConstraint
— Position to hold constant
"outerposition"
| "innerposition"
Position property to hold constant when adding, removing, or changing decorations, specified as one of the following values:
"outerposition"
— TheOuterPosition
property remains constant when you add, remove, or change decorations such as a title or an axis label. If any positional adjustments are needed, MATLAB adjusts theInnerPosition
property."innerposition"
— TheInnerPosition
property remains constant when you add, remove, or change decorations such as a title or an axis label. If any positional adjustments are needed, MATLAB adjusts theOuterPosition
property.
Note
Setting this property has no effect when the parent container is a
TiledChartLayout
object.
OuterPosition
— Outer size and location
[0 0 1 1]
(default) | four-element vector
Outer size and location, including the labels and legends, specified as a
four-element vector of the form [left bottom width
height]
. By default, MATLAB measures the values in units normalized to the parent
container. To change the units, set the Units
property.
The default value of [0 0 1 1]
includes the whole
interior of the container.
The
left
andbottom
elements define the distance from the lower-left corner of the container to the lower-left corner of the geographic bubble chart.The
width
andheight
elements are the dimensions of the geographic bubble chart, including a margin for the surrounding labels and legends.
This figure shows the areas defined by the
OuterPosition
values (blue) and the
InnerPosition
values (red).
Note
Setting this property has no effect when the parent container is a
TiledChartLayout
object.
InnerPosition
— Inner size and location
four-element vector
Inner size and location, excluding the labels and legends, specified as a
four-element vector of the form [left bottom width
height]
. By default, MATLAB measures the values in units normalized to the parent
container. To change the units, set the Units
property.
The
left
andbottom
elements define the distance from the lower-left corner of the container to the lower-left corner of the geographic bubble chart.The
width
andheight
elements are the dimensions of the geographic bubble chart, excluding the labels and legends.
This figure shows the areas defined by the
OuterPosition
values (blue) and the
InnerPosition
values (red).
Note
Setting this property has no effect when the parent container is a
TiledChartLayout
object.
Position
— Inner and location, excluding labels and legends
four-element vector
Size and location, excluding the labels and legends, specified as a
four-element vector of the form [left bottom width
height]
. This property is equivalent to the
InnerPosition
property.
Note
Setting this property has no effect when the parent container is a
TiledChartLayout
object.
Units
— Position units
'normalized'
(default) | 'inches'
| 'centimeters'
| 'points'
| 'pixels'
| 'characters'
Position units, specified as one of these values.
Units | Description |
---|---|
'normalized' (default) | Normalized with respect to the container, which is
typically the figure or a panel. The lower left corner
of the container maps to (0,0) , and
the upper right corner maps to
(1,1) . |
'inches' | Inches |
'centimeters' | Centimeters |
'characters' | Based on the default
|
'points' | Typography points. One point equals 1/72 of an inch. |
'pixels' |
Pixels. Starting in R2015b, distances in pixels are independent of your system resolution on Windows® and Macintosh systems:
On Linux® systems, the size of a pixel is determined by your system resolution. |
When specifying the units using a name-value argument during object
creation, you must set the Units
property before
specifying the properties that you want to use these units, such as
OuterPosition
.
Layout
— Layout options
empty LayoutOptions
array (default) | TiledChartLayoutOptions
object | GridLayoutOptions
object
Layout options, specified as a TiledChartLayoutOptions
or
GridLayoutOptions
object. This property is useful when the chart
is either in a tiled chart layout or a grid layout.
To position the chart within the grid of a tiled chart layout, set the
Tile
and TileSpan
properties on the
TiledChartLayoutOptions
object. For example, consider a 3-by-3
tiled chart layout. The layout has a grid of tiles in the center, and four tiles along
the outer edges. In practice, the grid is invisible and the outer tiles do not take up
space until you populate them with axes or charts.
This code places the chart c
in the third tile of the
grid.
c.Layout.Tile = 3;
To make the chart span multiple tiles, specify the TileSpan
property as a two-element vector. For example, this chart spans 2
rows and 3
columns of
tiles.
c.Layout.TileSpan = [2 3];
To place the chart in one of the surrounding tiles, specify the
Tile
property as "north"
,
"south"
, "east"
, or "west"
.
For example, setting the value to "east"
places the chart in the tile
to the right of the
grid.
c.Layout.Tile = "east";
To place the chart into a layout within an app, specify this property as a
GridLayoutOptions
object. For more information about working with
grid layouts in apps, see uigridlayout
.
If the chart is not a child of either a tiled chart layout or a grid layout (for example, if it is a child of a figure or panel) then this property is empty and has no effect.
Visible
— State of visibility
'on'
(default) | on/off logical value
Visibility of the geographic bubble chart, specified as
'on'
or 'off'
, or as numeric or
logical 1
(true
) or
0
(false
). A value of
'on'
is equivalent to true
, and
'off'
is equivalent to false
.
Thus, you can use the value of this property as a logical value. The value
is stored as an on/off logical value of type matlab.lang.OnOffSwitchState
.
Parent/Child
Parent
— Parent container
Figure
object | Panel
object | Tab
object | TiledChartLayout
object | GridLayout
object
Parent container, specified as a Figure
,
Panel
, Tab
,
TiledChartLayout
, or GridLayout
object.
HandleVisibility
— Visibility of object handle
"on"
(default) | "off"
| "callback"
Visibility of the object handle in the Children
property
of the parent, specified as one of these values:
"on"
— Object handle is always visible."off"
— Object handle is invisible at all times. This option is useful for preventing unintended changes by another function. SetHandleVisibility
to"off"
to temporarily hide the handle during the execution of that function."callback"
— Object handle is visible from within callbacks or functions invoked by callbacks, but not from within functions invoked from the command line. This option blocks access to the object at the command line, but permits callback functions to access it.
If the object is not listed in the Children
property of the parent, then
functions that obtain object handles by searching the object hierarchy or querying
handle properties cannot return it. Examples of such functions include the
get
, findobj
, gca
, gcf
, gco
, newplot
, cla
, clf
, and close
functions.
Hidden object handles are still valid. Set the root ShowHiddenHandles
property to "on"
to list all object handles regardless of their
HandleVisibility
property setting.
Version History
Introduced in R2017bR2023b: Some basemaps have improved appearance at high zoom levels
The "streets-light"
, "streets-dark"
, "streets"
, and "topographic"
basemaps hosted by Esri have an improved visual appearance at high zoom levels. For example, this image compares a basemap at zoom level 21 in R2023a with the same basemap and zoom level in R2023b.
The basemaps can also have different appearances at other zoom levels. For example, this image compares a basemap at zoom level 15 in R2023a with the same basemap and zoom level in R2023b.
R2020a: ActivePositionProperty
is not recommended
Starting in R2020a, setting or getting ActivePositionProperty
is not
recommended. Use the PositionConstraint
property instead.
There are no plans to remove ActivePositionProperty
at this time, but the
property is no longer listed when you call the set
,
get
, or properties
functions on the chart
object.
To update your code, make these changes:
Replace all instances of
ActivePositionProperty
withPositionConstraint
.Replace all references to the
"position"
option with the"innerposition"
option.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)