Parameters - hold : bool (default True) Whether to revert the data and view limits after the context manager exits. def hold_limits ( self, hold = True ): """ Keep track of the original view and data limits for the life of this context manager, optionally reverting any changes back to the original values after the manager exits. add_image ( image ) except AttributeError : # If add_image method doesn't exist (only available from # v1.4 onwards) we implement it ourselves. assert not bool ( args ) and not bool ( kwargs ) image = factory try : super ( GeoAxes, self ). append () else : # Args and kwargs not allowed. """ if hasattr ( factory, 'image_for_domain' ): # XXX TODO: Needs deprecating. Examples of image factories are :class:`cartopy.io.img_nest.NestedImageCollection` and :class:`cartopy.io.image_tiles.GoogleTiles`. Currently an image "factory" is just an object with a ``image_for_domain`` method. The advantage of this approach is that the limits of the map do not need to be known when adding the image factory, but can be deferred until everything which can effect the limits has been added. Any image "factory" added, will be asked to retrieve an image with associated metadata for a given bounding box at draw time. def add_image ( self, factory, * args, ** kwargs ): """ Adds an image "factory" to the Axes. #TRANSDATA MARKV PATCH#background_patch = None """The patch that provides the filled background of the projection.""" super ( GeoAxes, self ). outline_patch = None """The patch that provides the line bordering the projection.""" self. pop ( 'map_projection' ) """The :class:`` of this GeoAxes.""" self. All other args and keywords are passed through to :class:``. Kwargs: * map_projection - The target :class:`~` of this Axes object. pyplot.axes(projection=()) ntourf(x, y, data, transform=()) """ def _init_ ( self, * args, ** kwargs ): """ Create a GeoAxes object using standard matplotlib :class:`~` args and kwargs. For example:: # Plot latlon data on an OSGB map. geo_axes = pyplot.subplot(2, 2, 1, projection=()) When a source projection is provided to one of it's plotting methods, using the *transform* keyword, the standard matplotlib plot result is transformed from source coordinates to the target projection. geo_axes = pyplot.axes(projection=()) # Set up an OSGB map. For example:: # Set up a standard map for latlon data. This class replaces the matplotlib :class:`~` class when created with the *projection* keyword. Axes ): """ A subclass of :class:`` which represents a map :class:`~`. """ return InterProjectionTransform ( self. WeakKeyDictionary () """ A nested mapping from path, source CRS, and target projection to the resulting transformed paths:: else : mapping = result return result def inverted ( self ): """ Return a matplotlib :class:`~` from target to source coordinates. _version_ >= '1.3', ( 'Cartopy is only supported with ' 'matplotlib 1.3 or greater.' ) _PATH_TRANSFORM_CACHE = weakref. """ from _future_ import ( absolute_import, division, print_function ) import collections import contextlib import warnings import weakref import matplotlib as mpl import matplotlib.artist import matplotlib.axes from matplotlib.image import imread import ansforms as mtransforms import matplotlib.patches as mpatches import matplotlib.path as mpath import matplotlib.ticker as mticker import numpy as np import numpy.ma as ma import shapely.geometry as sgeom from cartopy import config import cartopy.crs as ccrs import cartopy.feature import cartopy.img_transform from _path import clip_path import _artist as feature_artist import as cpatch from _image_artist import SlippyImageArtist from cartopy.vector_transform import vector_scalar_to_grid assert matplotlib. When a matplotlib figure contains a GeoAxes the plotting commands can transform plot results from source coordinates to the GeoAxes' target projection. """ This module defines the :class:`GeoAxes` class, for use with matplotlib. #TRANSDATA MARKV LICENSE## You should have received a copy of the GNU Lesser General Public License # along with cartopy. See the # GNU Lesser General Public License for more details. # cartopy is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #TRANSDATA MARKV SOFTWARE## cartopy is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # (C) British Crown Copyright 2011 - 2017, Met Office # This file is part of cartopy.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |