This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

GeographicAxes Properties

Control geographic axes appearance and behavior

GeographicAxes properties control the appearance and behavior of a GeographicAxes object. By changing property values, you can modify certain aspects of the geographic axes. Set axes properties after plotting since some graphics functions reset axes properties.

Some graphics functions create geographic axes when plotting. Use gca to access the newly created axes. To create a geographic axes with default values for all properties, use the geoaxes function.

gx = geoaxes;

Maps

expand all

Map on which to plot data, specified as one of the string scalars or character vectors in the following table, or 'none'.

MathWorks® offers six basemaps for use with geographic axes and charts. The basemaps provide a variety of display options, from two-tone, land-ocean raster maps to color terrain maps. By default, geographic axes or charts use the 'darkwater' basemap, which is installed with the product. If you choose one of the other basemaps, the geographic axes or chart accesses the map over the Internet.

If you do not have consistent access to the Internet, you can download the basemaps hosted by MathWorks onto your local system. For more information about downloading basemaps, see Access Basemaps in MATLAB.

If you specify 'none', the geographic axes or chart plots your data with latitude-longitude grid, ticks, and labels, but does not include a map.

Basemaps

'darkwater' (default)

Land areas: light-to-moderate gray

Ocean and water areas: darker gray

Hosted by MathWorks.

'colorterrain'

Shaded relief map blended with a land cover palette. Humid lowlands are green and arid lowlands brown.

Hosted by MathWorks.

'grayland'

Land areas: light-to-moderate gray land

Ocean and water areas: white

Hosted by MathWorks.

'grayterrain'

Worldwide terrain depicted monochromatically in shades of gray, combining shaded relief that emphasizes both high mountains and the micro terrain found in lowlands.

Hosted by MathWorks.

'bluegreen'

Land areas: light green

Ocean and water areas: light blue

Hosted by MathWorks.

'landcover'

Satellite-derived land cover data and shaded relief presented with a light, natural palette suitable for making thematic and reference maps (includes ocean-bottom relief).

Hosted by MathWorks.

Example: gx = geoaxes(__,'Basemap','bluegreen')

Example: gx.Basemap = 'bluegreen'

Data Types: char | string

This property is read-only.

Latitude limits of map, specified as a 1-by-2 vector of real, finite values of the form [southern_limit northern_limit] in the range [-90,90]. Use the geolimits function to change latitude limits.

Example: [-85 85]

This property is read-only.

Longitude limits of map, specified as a 1-by-2 vector of real, finite values of the form [western_limit eastern_limit]. Values must be in the range (-Inf, Inf). Use the geolimits function to change longitude limits.

Example: [-100 100]

Center point of map in latitude and longitude, specified as a two-element vector of real, finite values of the form [center_latitude center_longitude].

Example: [38.6292 -95.2520]

Selection mode for the map center, specified as one of these values:

  • 'auto' — Object automatically selects the map center based on the range of data.

  • 'manual' — If you specify a value for MapCenter, the object sets this property to 'manual' automatically.

Example: gx.MapCenterMode = 'auto'

Magnification level of map, specified as a real, finite, numeric scalar from 0 through 25, inclusive. The value is a base 2 logarithmic map scale. Increasing the ZoomLevel value by one doubles the map scale.

Selection mode for zoom level, specified as one of these values:

  • 'auto' — Object selects the zoom level based on the range of data.

  • 'manual' — If you specify a value for ZoomLevel, the object sets this property to 'manual' automatically.

Example: gx.ZoomLevelMode = 'manual'

This property is read-only.

Scale bar showing proportional distances on a map, specified as a GeographicScalebar object. To modify the appearance and behavior of the scale bar, such as its visibility, use properties of the GeographicScalebar object. For more information about these properties, see GeographicScalebar Properties.

Example: sbar = gx.Scalebar returns the GeographicScalebar object.

Example: gx.Scalebar.Visible = 'off'; sets the value of the GeographicScalebar property.

Font

expand all

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.

Font size, specified as a scalar numeric value. The font size affects the title, tick labels, legends, colorbars, and scale bar associated with the axes. The default font size depends on the specific operating system and locale. By default, the font size is measured in points. To change the units, set the FontUnits property.

MATLAB® automatically scales some of the text to a percentage of the axes font size.

  • Titles — 110% of the axes font size by default. To control the scaling, use the TitleFontSizeMultiplier and LabelFontSizeMultiplier properties.

  • Legends and colorbars — 90% of the axes font size by default. To specify a different font size, set the FontSize property for the Legend or Colorbar object instead.

  • Scale bar — 80% of the axes font size by default.

Example: gx.FontSize = 12

Selection mode for the font size, specified as one of these values:

  • 'auto' — Font size specified by MATLAB. If you resize the axes to be smaller than the default size, the font size might scale down to improve readability and layout.

  • 'manual' — Font size specified manually. Do not scale the font size as the axes size changes. To specify the font size, set the FontSize property.

Character thickness, specified as 'normal' or 'bold'.

MATLAB uses the FontWeight property to select a font from those available on your system. Not all fonts have a bold weight. Therefore, specifying a bold font weight can still result in the normal font weight.

Character slant, specified as 'normal' or 'italic'.

Not all fonts have both font styles. Therefore, the italic font might look the same as the normal font.

Scale factor for the label font size, specified as a numeric value greater than 0. The scale factor is applied to the value of the FontSize property to determine the font size for the label.

Example: gx.LabelFontSizeMultiplier = 1.75

Scale factor for the title font size, specified as a numeric value greater than 0. The scale factor is applied to the value of the FontSize property to determine the font size for the title.

Example: gx.TitleFontSizeMultiplier = 1.75

Title character thickness, specified as one of these values:

  • 'bold' — Thicker characters outlines than normal

  • 'normal' — Default weight as defined by the particular font

Example: gx.TitleFontWeight = 'normal'

Font size units, specified as one of these values.

UnitsDescription
'points'Points. One point equals 1/72 inch.
'inches'Inches.
'centimeters'Centimeters.
'normalized' Interpret font size as a fraction of the axes height. If you resize the axes, the font size modifies accordingly. For example, if the FontSize is 0.1 in normalized units, then the text is 1/10 of the height value stored in the axes Position property.
'pixels'

Pixels.

Starting in R2015b, distances in pixels are independent of your system resolution on Windows® and Macintosh systems.

  • On Windows systems, a pixel is 1/96th of an inch.

  • On Macintosh systems, a pixel is 1/72nd of an inch.

  • On Linux® systems, the size of a pixel is determined by your system resolution.

To set both the font size and the font units in a single function call, you first must set the FontUnits property so that the Axes object correctly interprets the specified font size.

Ticks

expand all

Tick mark direction, specified as one of these values.

ValueDescriptionExample
'in'Direct the tick marks inward from the axis lines.

'out'Direct the tick marks outward from the axis lines.

'both'Center the tick marks over the axis lines.

Example: gx.TickDir = 'out';

Selection mode for tick mark direction set by the TickDir property, specified as one of these values.

  • 'auto' — Automatically select the tick direction based on the current view.

  • 'manual' — Manually specify the tick direction. To specify the tick direction, set the TickDir property.

Example: gx.TickDirMode = 'auto';

Tick mark length, specified as a two-element vector of the form [length unused]. length is the tick mark length. Specify the values in units normalized relative to the longest axes dimension. The GeographicRuler object uses a two-element vector to be consistent with the value of this property in other ruler objects but the second element is unused.

Note

Setting the TickLength property automatically sets the TickLength property in the GeographicRuler objects associated with the LatitudeAxis and LongitudeAxis properties to the same value. Conversely, setting the TickLength property in the GeographicRuler objects does not automatically set the same property in the axes object. To prevent the axes property value from overriding the ruler property value, set the axes property value first, and then set the ruler property value.

Example: gx.TickLength = [0.02 0.0];

Tick label format, specified as one of the following values.

FormatDescriptionExample
'dd'Decimal degrees plus compass direction
23°N
'dm'Degrees and decimal minutes plus compass direction
18°30'W
'dms' (default)Degrees, minutes, and decimal seconds plus compass direction
110°06'18.5"E
'-dd'Decimal degrees with a minus sign (-) to indicate south and west
-115.25°
'-dm'Degrees and decimal minutes with a minus sign (-) to indicate south and west
-5°45.5'
'-dms'Degrees, minutes, and decimal seconds with a minus sign (-) to indicate south and west
-3°21'05"

The default label format includes degrees, minutes, and seconds. However, the minutes and seconds part of the tick label is not included until you zoom in on the map to at least a zoom level of 14.

Example: gx.TickLabelFormat = '-dm';

Rulers

expand all

Latitude ruler, specified as a GeographicRuler object. Use properties of the GeographicRuler object to control the appearance and behavior of the axis ruler. For more information, see GeographicRuler Properties.

Example: latruler = gx.LatitudeAxis;

Example: gx.LatitudeAxis.TickLabelRotation = 45;

Longitude ruler, specified as a GeographicRuler object. Use properties of the GeographicRuler object to control the appearance and behavior of the axis ruler. For more information, see GeographicRuler Properties.

Example: lonruler = gx.LongitudeAxis;

Example: gx.LongitudeAxis.TickDirection = 'out';

Color of axis lines, tick values, and labels, specified as an RGB triplet, hexadecimal color code, color name, or short color name.

For a custom color, specify an RGB triplet or a hexadecimal color code.

  • An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,1]; for example, [0.4 0.6 0.7].

  • A hexadecimal color code is a character vector or a string scalar that starts with a hash symbol (#) followed by three or six hexadecimal digits, which can range from 0 to F. The values are not case sensitive. Thus, the color codes '#FF8800', '#ff8800', '#F80', and '#f80' are equivalent.

Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and hexadecimal color codes.

Color NameShort NameRGB TripletHexadecimal Color CodeAppearance
'red''r'[1 0 0]'#FF0000'

'green''g'[0 1 0]'#00FF00'

'blue''b'[0 0 1]'#0000FF'

'cyan' 'c'[0 1 1]'#00FFFF'

'magenta''m'[1 0 1]'#FF00FF'

'yellow''y'[1 1 0]'#FFFF00'

'black''k'[0 0 0]'#000000'

'white''w'[1 1 1]'#FFFFFF'

'none'Not applicableNot applicableNot applicableNo color

Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB uses in many types of plots.

RGB TripletHexadecimal Color CodeAppearance
[0 0.4470 0.7410]'#0072BD'

[0.8500 0.3250 0.0980]'#D95319'

[0.9290 0.6940 0.1250]'#EDB120'

[0.4940 0.1840 0.5560]'#7E2F8E'

[0.4660 0.6740 0.1880]'#77AC30'

[0.3010 0.7450 0.9330]'#4DBEEE'

[0.6350 0.0780 0.1840]'#A2142F'

Note

Setting the AxisColor property automatically sets the Color property in the GeographicRuler and GeographicScalebar objects to the same value. The GeographicRuler object controls the behavior and appearance of the rulers in the geographic axes. The GeographicScalebar object controls the scale bar in the geographic axes. Conversely, setting the Color property in the GeographicRuler or GeographicScalebar object does not automatically set the AxisColor property in the axes object. To prevent the axes property value from overriding the ruler or scale bar property value, set the axes property value first, and then set the ruler or scale bar property value.

Example: gx.AxisColor = [0 0 1];

Example: gx.AxisColor = 'b';

Example: gx.AxisColor = 'blue';

Example: gx.AxisColor = '#0000FF';

Grids

expand all

Visibility of latitude and longitude lines on map, specified as 'on', show grid lines, or 'off', do not show grid lines.

Example: gx.Grid = 'off';

Line style for grid lines, specified as one of the line styles in this table.

Line StyleDescriptionResulting Line
'-'Solid line

'--'Dashed line

':'Dotted line

'-.'Dash-dotted line

'none'No lineNo line

To display the grid lines, use the grid on command or set the Grid property to 'on'.

Example: gx.GridLineStyle = '--'

Background color, specified as an RGB triplet, a hexadecimal color code, a color name, or a short color name.

For a custom color, specify an RGB triplet or a hexadecimal color code.

  • An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,1]; for example, [0.4 0.6 0.7].

  • A hexadecimal color code is a character vector or a string scalar that starts with a hash symbol (#) followed by three or six hexadecimal digits, which can range from 0 to F. The values are not case sensitive. Thus, the color codes '#FF8800', '#ff8800', '#F80', and '#f80' are equivalent.

Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and hexadecimal color codes.

Color NameShort NameRGB TripletHexadecimal Color CodeAppearance
'red''r'[1 0 0]'#FF0000'

'green''g'[0 1 0]'#00FF00'

'blue''b'[0 0 1]'#0000FF'

'cyan' 'c'[0 1 1]'#00FFFF'

'magenta''m'[1 0 1]'#FF00FF'

'yellow''y'[1 1 0]'#FFFF00'

'black''k'[0 0 0]'#000000'

'white''w'[1 1 1]'#FFFFFF'

'none'Not applicableNot applicableNot applicableNo color

Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB uses in many types of plots.

RGB TripletHexadecimal Color CodeAppearance
[0 0.4470 0.7410]'#0072BD'

[0.8500 0.3250 0.0980]'#D95319'

[0.9290 0.6940 0.1250]'#EDB120'

[0.4940 0.1840 0.5560]'#7E2F8E'

[0.4660 0.6740 0.1880]'#77AC30'

[0.3010 0.7450 0.9330]'#4DBEEE'

[0.6350 0.0780 0.1840]'#A2142F'

Example: gx.GridColor = [0 0 1];

Example: gx.GridColor = 'b';

Example: gx.GridColor = 'blue';

Example: gx.GridColor = '#0000FF';

Property for setting the grid color, specified as one of these values:

  • 'auto' — Object automatically selects the color.

  • 'manual' — To set the grid line color for all directions, use GridColor.

Grid-line transparency, specified as a value in the range [0,1]. A value of 1 means opaque and a value of 0 means completely transparent.

Example: gx.GridAlpha = 0.5

Selection mode for the GridAlpha property, specified as one of these values:

  • 'auto' — Object selects the transparency value.

  • 'manual' — To specify the transparency value, use the GridAlpha property.

Example: gx.GridAlphaMode = 'auto'

Labels

expand all

Axes title, specified as a Text object or a categorical value.

If you use a Text object, specify the title as the value of the String property of the Text object: gx.Title.String = 'My Geographic Plot'. To change the title appearance, such as the font style or color, use other Text object properties. For a complete list of properties, see Text Properties.

If you specify this property as a categorical array, MATLAB uses the values in the array, not the categories.

You can also use the title function to specify a title.

Example: gx.Title.String = 'My Geographic Plot'

Latitude axis label, specified as a Text object. To specify a label, set the String property of the Text object. To change the label appearance, such as the font style or color, set other Text object properties. For a complete list of properties, see Text Properties.

Example: gx.LatitudeLabel.String = 'My Latitude'

Longitude axis label, specified as a Text object. To specify a label, set the String property of the text object. To change the label appearance, such as the font style or color, set other Text object properties. For a complete list of properties, see Text Properties.

Example: gx.LongitudeLabel.String = 'My Longitude'

This property is read-only.

Legend associated with a geographic axes, specified as a Legend object. To add a legend to the geographic axes, use the legend function. Then, you can use this property to modify the legend. For a complete list of properties, see Legend Properties.

geoplot(rand(3))
legend({'Line 1','Line 2','Line 3'},'FontSize',12)
gx = gca;
gx.Legend.TextColor = 'red';

You also can use this property to determine if the geographic axes has a legend.

gx = gca;
lgd = gx.Legend
if ~isempty(lgd)
    disp('Legend Exists')
end

Multiple Plots

expand all

Color order, specified as a three-column matrix of RGB triplets. Each row of the matrix defines one color in the color order. The default color order has seven colors.

Default Color OrderAssociated RGB Triplets

    [    0    0.4470    0.7410
    0.8500    0.3250    0.0980
    0.9290    0.6940    0.1250
    0.4940    0.1840    0.5560
    0.4660    0.6740    0.1880
    0.3010    0.7450    0.9330
    0.6350    0.0780    0.1840]

Next color to use in the color order, specified as a positive integer. For example, if this property is set to 1, then the next plot added to the axes uses the first color in the color order. If the index value exceeds the number of colors in the color order, the index value modulo of the number of colors determines the next color used.

If you used a hold on command or if the NextPlot property of the axes is set to 'add', the color order index value increases every time a new plot is added. Reset the color order by setting the ColorOrderIndex property to 1.

Example: gx.ColorOrderIndex = 5

Line-style order, specified as a character vector, a cell array of character vectors, or a string array. Create each element using one or more of the line-style specifiers listed in the table. You can combine a line and a marker specifier in a single element, such as '-*'.

MATLAB cycles through the line styles only after using all the colors contained in the ColorOrder property. The default LineStyleOrder has only one line style, '-'.

SpecifierLine Style
'-' (default) Solid line
'--'Dashed line
':'Dotted line
'-.'Dash-dotted line
'+'Plus sign markers
'o'Circle markers
'*'Star markers
'.'Point markers
'x'Cross markers
's'Square markers
'd'Diamond markers
'^'Upward-pointing triangle markers
'v'Downward-pointing triangle markers
'>'Right-pointing triangle markers
'<'Left-pointing triangle markers
'p'Five-pointed star (pentagram) markers
'h'Six-pointed star (hexagram) markers

Example: {'-*',':','o'}

Next line style to use in the line-style order, specified as a positive integer. For example, if this property is set to 1, then the next plot added to the axes uses the first line style in the line-style order. If the index value exceeds the number of line styles in the line-style order, then the index value modulo of the number of line styles determines the next line style used.

If you used a hold on command or if the NextPlot property of the axes is set to 'add', then the index value increases every time you add a new plot. Subsequent plots cycle through the line-style order. Reset the line-style order by setting the LineStyleOrderIndex property to 1.

Example: gx.LineStyleOrderIndex = 1

Properties to reset when adding a new plot to the axes, specified as one of these values:

  • 'add' — Add new plots to the existing axes. Do not delete existing plots or reset axes properties before displaying the new plot.

  • 'replacechildren' — Delete existing plots before displaying the new plot. Reset the ColorOrderIndex and LineStyleOrderIndex properties to 1, but do not reset other axes properties. The next plot added to the axes uses the first color and line style based on the ColorOrder and LineStyle order properties. This value is similar to using cla before every new plot.

  • 'replace' — Delete existing plots and reset axes properties, except Position and Units, to their default values before displaying the new plot.

  • 'replaceall' — Delete existing plots and reset axes properties, except Position and Units, to their default values before displaying the new plot. This value is similar to using cla reset before every new plot.

Figures also have a NextPlot property. Alternatively, you can use the newplot function to prepare figures and axes for subsequent graphics commands.

Order for rendering objects, specified as one of these values:

  • 'depth' — Draw objects in back-to-front order based on the current view. Use this value to ensure that objects in front of other objects are drawn correctly.

  • 'childorder' — Draw objects in the order in which they are created by graphics functions, without considering the relationship of the objects in three dimensionsThis value can result in faster rendering, particularly if the figure is very large, but also can result in improper depth sorting of the objects displayed.

Color and Transparency Maps

expand all

Colormap, specified as an m-by-3 array of RGB (red, green, blue) triplets that define m individual colors. Alternatively, you can use the colormap function to change the color map.

MATLAB accesses these colors by their row number.

Example: gx.Colormap = [1 0 1; 0 0 1; 1 1 0] sets the color map to three colors: magenta, blue, and yellow.

Scale for color mapping, specified as one of these values:

  • 'linear' — Linear scale. The tick values along the colorbar also use a linear scale.

  • 'log' — Log scale. The tick values along the colorbar also use a log scale.

Example: gx.ColorScale = 'log'

Color limits for the colormap, specified as a two-element vector of the form [cmin cmax].

If the associated mode property is set to 'auto', then MATLAB chooses the color limits. If you assign a value to this property, then MATLAB sets the mode to 'manual' and does not automatically choose the color limits.

Selection mode for the CLim property, specified as one of these values:

  • 'auto' — Automatically select the limits based on the color data of the graphics objects contained in the axes.

  • 'manual' — Manually specify the values. To specify the values, set the CLim property. The values do not change when the limits of the axes children change.

Transparency map, specified as an array of finite alpha values that progress linearly from 0 to 1. The size of the array can be m-by-1 or 1-by-m. MATLAB accesses alpha values by their index in the array. An alphamap can be any length.

Scale for transparency mapping, specified as one of these values:

  • 'linear' — Linear scale

  • 'log' — Log scale

Example: gx.AlphaScale = 'log'

Alpha limits for alphamap, specified as a two-element vector of the form [amin amax].

If the associated mode property is set to 'auto', then MATLAB chooses the alpha limits. If you set this property, then MATLAB sets the mode to 'manual' and does not automatically choose the alpha limits.

Selection mode for the ALim property, specified as one of these values:

  • 'auto' — Automatically select the limits based on the AlphaData values of the graphics objects contained in the axes.

  • 'manual' — Manually specify the alpha limits. To specify the alpha limits, set the ALim property.

Box Styling

expand all

Background color, specified as an RGB triplet, a hexadecimal color code, a color name, or a color short name. The background color is only visible when the Basemap property is set to 'none'.

For a custom color, specify an RGB triplet or a hexadecimal color code.

  • An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,1]; for example, [0.4 0.6 0.7].

  • A hexadecimal color code is a character vector or a string scalar that starts with a hash symbol (#) followed by three or six hexadecimal digits, which can range from 0 to F. The values are not case sensitive. Thus, the color codes '#FF8800', '#ff8800', '#F80', and '#f80' are equivalent.

Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and hexadecimal color codes.

Color NameShort NameRGB TripletHexadecimal Color CodeAppearance
'red''r'[1 0 0]'#FF0000'

'green''g'[0 1 0]'#00FF00'

'blue''b'[0 0 1]'#0000FF'

'cyan' 'c'[0 1 1]'#00FFFF'

'magenta''m'[1 0 1]'#FF00FF'

'yellow''y'[1 1 0]'#FFFF00'

'black''k'[0 0 0]'#000000'

'white''w'[1 1 1]'#FFFFFF'

'none'Not applicableNot applicableNot applicableNo color

Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB uses in many types of plots.

RGB TripletHexadecimal Color CodeAppearance
[0 0.4470 0.7410]'#0072BD'

[0.8500 0.3250 0.0980]'#D95319'

[0.9290 0.6940 0.1250]'#EDB120'

[0.4940 0.1840 0.5560]'#7E2F8E'

[0.4660 0.6740 0.1880]'#77AC30'

[0.3010 0.7450 0.9330]'#4DBEEE'

[0.6350 0.0780 0.1840]'#A2142F'

Example: gx.Color = [0 0 1];

Example: gx.Color = 'b';

Example: gx.Color = 'blue';

Example: gx.Color = '#0000FF';

Width of lines, specified as a positive scalar value in point units. One point equals 1/72 inch.

Example: gx.LineWidth = 1.5

Outline around the geographic axes, specified as either 'on' or 'off'.

Example: gx.Box = 'off'

Position

expand all

Size and position of the geographic axes, including the labels and margins, specified as a four-element vector of the form [left bottom width height]. This vector defines the extents of the rectangle that encloses the outer bounds of the geographic axes. The left and bottom elements define the distance from the lower-left corner of the figure or panel that contains the geographic axes to the lower-left corner of the rectangle. The width and height elements are the rectangle dimensions.

By default, the values are measured in units normalized to the container. To change the units, set the Units property. The default value of [0 0 1 1] includes the whole interior of the container.

Size and position of the geographic axes, not including labels or margins, specified as a four-element vector of the form [left bottom width height]. This vector defines the extents of the tightest bounding rectangle that encloses the geographic axes. The left and bottom elements define the distance from the lower-left corner of the container to the lower-left corner of the rectangle. The width and height elements are the rectangle dimensions.

By default, the values are measured in units normalized to the container. To change the units, set the Units property.

Example: gx.Position = [0 0 1 1] specifies no distance between the lower-left corner of the container to the rectangle and width and height to fill the entire container.

This property is read-only.

Margins for the text labels, returned as a four-element vector of the form [left bottom right top]. This property is read-only.

The elements define the distances between the bounds of the Position property and the extent of the geographic axes text labels and title. By default, the values are measured in units normalized to the figure or uipanel that contains the geographic axes. To change the units, set the Units property.

The Position property and the TightInset property define the tightest bounding box that encloses the geographic axes and its labels and title.

Active position property during resize operation, specified as one of these values:

  • 'outerposition' — Hold the OuterPosition property constant.

  • 'position' — Hold the Position property constant.

A figure can change size if you interactively resize it or during a printing or exporting operation.

Position units, specified as one of these values.

UnitsDescription
'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 uicontrol font of the graphics root object:

  • Character width = width of letter x.

  • Character height = distance between the baselines of two lines of text.

'points'Typography points. One point equals 1/72 inch.
'pixels'

Pixels.

  • On Windows systems, a pixel is 1/96th of an inch.

  • On Macintosh systems, a pixel is 1/72nd of an inch.

  • On Linux systems, the size of a pixel is determined by your system resolution.

When specifying the units as a Name,Value pair during object creation, you must set the Units property before specifying the properties that you want to use these units, such as Position.

Interactivity

expand all

Data exploration toolbar, specified as an AxesToolbar object. The toolbar appears at the top-right corner of the geographic axes when you hover over it. The toolbar provides quick access to data exploration tools, such as zooming, restore view, and datatips.

If you do not want the toolbar to appear when you hover over the geographic axes, set the Visible property of the AxesToolbar object to 'off'. For more information about the properties of an AxesToolbar object, see AxesToolbar Properties.

Example: gx.Toolbar.Visible = 'off'

State of visibility of the geographic axes, specified as one of these values:

  • 'on' — Display the object.

  • 'off' — Hide the object without deleting it. You still can access the properties of an invisible object.

This property is read-only.

Location of mouse pointer, specified as a 2-by-3 array of the form:

[lat lon 0
 lat lon 0]

The CurrentPoint property contains the latitude (lat) and longitude (lon) coordinates of the mouse pointer with respect to the geographic axes. The (lat,lon) points indicate the location of the last mouse click. However, if the figure has a WindowButtonMotionFcn callback defined, then the (lat,lon) points indicate the last location of the mouse pointer.

The format of the return value is consistent with the return value of the CurrentPoint property of the Axes object. For geographic axes, the third column of the return value is always zero. The latitude and longitude values in the second row are duplicates of the values in the first row.

Example: [52.1411 -125.1167 0; 52.1411 -125.1167 0]

Context menu, specified as a ContextMenu object. Use this property to display a context menu when you right-click the object. Create the context menu using the uicontextmenu function.

Note

If the PickableParts property is set to 'none' or if the HitTest property is set to 'off', then the context menu does not appear.

Selection state, specified as one of these values:

  • 'on' — Selected. If you click the object when in plot edit mode, then MATLAB sets its Selected property to 'on'. If the SelectionHighlight property also is set to 'on', then MATLAB displays selection handles around the object.

  • 'off' — Not selected.

Display of selection handles when selected, specified as one of these values:

  • 'on' — Display selection handles when the Selected property is set to 'on'.

  • 'off' — Never display selection handles, even when the Selected property is set to 'on'.

Callbacks

expand all

Mouse-click callback, specified as one of these values:

  • Function handle

  • Cell array containing a function handle and additional arguments

  • Character vector that is a valid MATLAB command or function, which is evaluated in the base workspace (not recommended)

Use this property to execute code when you click the object. If you specify this property using a function handle, then MATLAB passes two arguments to the callback function when executing the callback:

  • Clicked object — Access properties of the clicked object from within the callback function.

  • Event data — Empty argument. Replace it with the tilde character (~) in the function definition to indicate that this argument is not used.

For more information on how to use function handles to define callback functions, see Callback Definition.

Note

If the PickableParts property is set to 'none' or if the HitTest property is set to 'off', then this callback does not execute.

Creation callback, specified as one of these values:

  • Function handle

  • Cell array containing a function handle and additional arguments

  • Character vector that is a valid MATLAB command or function, which is evaluated in the base workspace (not recommended)

Use this property to execute code when you create the object. MATLAB executes the callback after creating the object and setting all of its properties. Setting the CreateFcn property on an existing object has no effect. To have an effect, you must specify the CreateFcn property during object creation. One way to specify the property during object creation is to set the default property value for the object. See Default Property Values for more information.

If you specify this callback using a function handle, then MATLAB passes two arguments to the callback function when executing the callback:

  • Created object — Access properties of the object from within the callback function. You also can access the object through the CallbackObject property of the graphics root object, which can be queried using the gcbo function.

  • Event data — Empty argument. Replace it with the tilde character (~) in the function definition to indicate that this argument is not used.

For more information on how to use function handles to define callback functions, see Callback Definition.

Deletion callback, specified as one of these values:

  • Function handle

  • Cell array containing a function handle and additional arguments

  • Character vector that is a valid MATLAB command or function, which is evaluated in the base workspace (not recommended)

Use this property to execute code when you delete the object. MATLAB executes the callback before destroying the object so that the callback can access its property values.

If you specify this callback using a function handle, then MATLAB passes two arguments to the callback function when executing the callback:

  • Deleted object — Access properties of the object from within the callback function. You also can access the object through the CallbackObject property of the graphics root object, which can be queried using the gcbo function.

  • Event data — Empty argument. Replace it with the tilde character (~) in the function definition to indicate that this argument is not used.

For more information on how to use function handles to define callback functions, see Callback Definition.

Callback Execution Control

expand all

Callback interruption, specified as 'on' or 'off'. The Interruptible property determines if a running callback can be interrupted.

Note

Consider these callback states where:

  • The running callback is the currently executing callback.

  • The interrupting callback is a callback that tries to interrupt the running callback.

Whenever MATLAB invokes a callback, that callback attempts to interrupt a running callback. The Interruptible property of the object owning the running callback determines if interruption is permitted. If interruption is not permitted, then the BusyAction property of the object owning the interrupting callback determines if it is discarded or put in the queue.

The Interruptible property determines if another callback can interrupt the ButtonDownFcn callback of the GeographicAxes object. The Interruptible property has two values:

  • 'on' — Interruptible. Interruption occurs at the next point where MATLAB processes the queue. For example, queues are processed by commands such as drawnow, figure, getframe, waitfor, pause, and waitbar.

    • If the running callback contains one of these commands, then MATLAB stops the execution of the callback at this point and executes the interrupting callback. MATLAB resumes executing the running callback when the interrupting callback completes. For more information, see Interrupt Callback Execution.

    • If the running callback does not contain one of these commands, then MATLAB finishes executing the callback without interruption.

  • 'off' — Not interruptible. MATLAB finishes executing the running callback without any interruptions.

Callback queuing specified as 'queue' or 'cancel'. The BusyAction property determines how MATLAB handles the execution of interrupting callbacks.

Consider these callback states where:

  • The running callback is the currently executing callback.

  • The interrupting callback is a callback that tries to interrupt the running callback.

Whenever MATLAB invokes a callback, that callback attempts to interrupt a running callback. The Interruptible property of the object owning the running callback determines if interruption is permitted. If interruption is not permitted, then the BusyAction property of the object owning the interrupting callback determines if it is discarded or put in the queue.

If a callback of the GeographicAxes object tries to interrupt a running callback that cannot be interrupted, then the BusyAction property determines if it is discarded or put in the queue. Specify the BusyAction property as one of these values:

  • 'queue' — Put the interrupting callback in a queue to be processed after the running callback finishes execution. (default behavior)

  • 'cancel' — Discard the interrupting callback.

Ability to capture mouse clicks, specified as one of these values:

  • 'visible' — Capture mouse clicks only when visible. The Visible property must be set to 'on'. The HitTest property determines if the GeographicAxes object responds to the click or if an ancestor does.

  • 'all' — Capture mouse clicks regardless of visibility. The Visible property can be set to 'on' or 'off'. The HitTest property determines if the GeographicAxes object responds to the click or if an ancestor does.

  • 'none' — Cannot capture mouse clicks. Clicking the GeographicAxes object passes the click to the object below it in the current view of the figure window, which is typically the axes or the figure. The HitTest property has no effect.

If you want an object to be clickable when it is underneath other objects that you do not want to be clickable, then set the PickableParts property of the other objects to 'none' so that the click passes through them.

Response to captured mouse clicks, specified as one of these values:

  • 'on' — Trigger the ButtonDownFcn callback of the GeographicAxes object. If you have defined the UIContextMenu property, then invoke the context menu.

  • 'off' — Trigger the callbacks for the nearest ancestor of the GeographicAxes object that has one of these:

    • HitTest property set to 'on'

    • PickableParts property set to a value that enables the ancestor to capture mouse clicks

Note

The PickableParts property determines if the GeographicAxes object can capture mouse clicks. If it cannot, then the HitTest property has no effect.

This property is read-only.

Deletion status, returned as 'off' or 'on'. MATLAB sets the BeingDeleted property to 'on' when the delete function of the object begins execution (see the DeleteFcn property). The BeingDeleted property remains set to 'on' until the object no longer exists.

Check the value of the BeingDeleted property if you need to verify that the object is not about to be deleted before querying or modifying it.

Parent/Child

expand all

Parent of geographic axes, specified as Figure object, Panel object, or Tab object.

Children, returned as an array of graphics objects. Use this property to view a list of the children or to reorder the children by setting the property to a permutation of itself.

You cannot add or remove children using the Children property. To add a child to this list, set the Parent property of the child graphics object to the GeographicAxes object.

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 to the UI by another function. Set the HandleVisibility 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.

Identifiers

expand all

This property is read-only.

Type of graphics object, returned as 'geoaxes'.

Tag to associate with the Geographic Axes object, specified as a character vector or string scalar.

Use this property to find Geographic Axes objects in a hierarchy. For example, you can use the findobj function to find Geographic Axes objects that have a specific Tag property value.

Example: 'January Data'

User data to associate with the Geographic Axes object, specified as any MATLAB data, for example, a scalar, vector, matrix, cell array, character array, table, or structure. MATLAB does not use this data.

To associate multiple sets of data or to attach a field name to the data, use the getappdata and setappdata functions.

Example: 1:100

Introduced in R2018b