Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

geolimits

Set or query geographic limits

Syntax

geolimits(latlim,lonlim)
geolimits('auto')
geolimits('manual')
[latitudeLimits,longitudeLimits] = geolimits(___)
[latitudeLimits,longitudeLimits] = geolimits
___ = geolimits(gb,___)

Description

example

geolimits(latlim,lonlim) adjusts the geographic limits of the current geographic bubble chart to the range in latitude from latlim(1) to latlim(2) and in longitude from lonlim(1) to lonlim(2).

geolimits('auto') lets the chart choose its geographic limits based on its data locations.

geolimits('manual') requests that the chart preserve its current limits as closely as possible when the map is resized or data locations are changed.

[latitudeLimits,longitudeLimits] = geolimits(___) adjusts the geographic limits and returns the actual limits of the map.

Note

Typically, the actual limits chosen by geolimits are greater in extent than the requested limits because the zoom level of the map is quantized and its limits are managed to maintain a correct north-south/east-west aspect.

example

[latitudeLimits,longitudeLimits] = geolimits returns the actual latitude limits and longitude limits of the current geographic bubble chart.

___ = geolimits(gb,___) operates on the geographic bubble chart specified by gb.

Examples

collapse all

Read tsunami data from a spreadsheet into a table.

tsunamis = readtable('tsunamis.xlsx');

Get the latitude and longitude data from the table. This data specifies the locations of the tsunamis. In addition, get data about the size of the tsunami from the table.

lat = tsunamis.Latitude;
lon = tsunamis.Longitude;
sizedata = tsunamis.MaxHeight;

Create a geographic bubble chart with the tsunami data. The example sets the title of the size legend.

gb = geobubble(lat,lon,sizedata,'SizeLegendTitle','Maximum Height');

Get the current geographic limits of the chart. By default, geobubble sets the map limits large enough to encompass all the locations in the data.

[latlim, lonlim] = geolimits
latlim = 

  -83.4882   85.0511

lonlim = 

 -295.8338   37.8079

Modify the geographic limits to get a closer look at tsunami activity in Alaska. The example also specifies a title for the geographic bubble chart.

geolimits([50 65],[-175 -130])
gb.Title = 'Tsunamis in Alaska'
gb = 
  GeographicBubbleChart with properties:

          Basemap: 'darkwater'
        MapLayout: 'normal'
     LatitudeData: [162x1 double]
    LongitudeData: [162x1 double]
         SizeData: [162x1 double]
        ColorData: []

  Show all properties

Get the actual geographic limits used by the chart. Due to zoom level quantization and aspect ratio preservation, the actual limits may differ from the requested limits.

[latlim, lonlim] = geolimits
latlim = 

   43.8548   68.5475

lonlim = 

 -175.0000 -130.0000

Input Arguments

collapse all

Limits of the geographic bubble chart in latitude, specified as a two-element vector.

Example: [50 65]

Data Types: single | double

Limits of the geographic bubble chart in longitude, specified as a two-element vector.

Example: [-175 -130]

Data Types: single | double

Geographic bubble chart to adjust, specified as a handle to a geographic bubble chart.

Output Arguments

collapse all

Actual latitude limits of map, returned as two-element vector.

Actual longitude limits of map, returned as two-element vector.

Introduced in R2017b

Was this topic helpful?