class cartopy.feature.AdaptiveScaler(default_scale, limits)[source]#

Automatically select scale of geometries based on extent of plotted axes.

  • default_scale – Coarsest scale used as default when plot is at maximum extent.

  • limits – Scale-extent pairs at which scale of geometries change. Must be a tuple of tuples ordered from coarsest to finest scales. Limit values are the upper bounds for their corresponding scale.


>>> s = AdaptiveScaler('coarse',
...           (('intermediate', 30), ('fine', 10)))
>>> s.scale_from_extent([-180, 180, -90, 90])
>>> s.scale_from_extent([-5, 6, 45, 56])
>>> s.scale_from_extent([-5, 5, 45, 56])

Given an extent, update the scale.


extent – The boundaries of the plotted area of a projection. The coordinate system of the extent should be constant, and at the same scale as the scales argument in the constructor.