cartopy.mpl.slippy_image_artist.SlippyImageArtist#
- class cartopy.mpl.slippy_image_artist.SlippyImageArtist(ax, raster_source, **kwargs)[source]#
Bases:
AxesImageA subclass of
AxesImagewhich provides an interface for getting a raster from the given object with interactive slippy map type functionality.Kwargs are passed to the AxesImage constructor.
- Parameters:
colorizer (
colorizer.Colorizer)
- draw(renderer, *args, **kwargs)[source]#
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (
Artist.get_visiblereturns False).- Parameters:
renderer (
RendererBasesubclass.)
Notes
This method is overridden in the Artist subclasses.
- get_window_extent(renderer=None)[source]#
Get the artist’s bounding box in display space, ignoring clipping.
The bounding box’s width and height are non-negative.
Subclasses should override for inclusion in the bounding box “tight” calculation. Default is to return an empty bounding box at 0, 0.
Warning
The extent can change due to any changes in the transform stack, such as changing the Axes limits, the figure size, the canvas used (as is done when saving a figure), or the DPI.
Relying on a once-retrieved window extent can lead to unexpected behavior in various cases such as interactive figures being resized or moved to a screen with different dpi, or figures that look fine on screen render incorrectly when saved to file.
To get accurate results you may need to manually call
savefigordraw_without_renderingto have Matplotlib compute the rendered size.- Parameters:
renderer (
RendererBase, optional) – Renderer used to draw the figure (i.e.fig.canvas.get_renderer()).
See also
Artist.get_tightbboxGet the artist bounding box, taking clipping into account.
- set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, array=<UNSET>, clim=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, cmap=<UNSET>, data=<UNSET>, extent=<UNSET>, filternorm=<UNSET>, filterrad=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, interpolation=<UNSET>, interpolation_stage=<UNSET>, label=<UNSET>, mouseover=<UNSET>, norm=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, resample=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, zorder=<UNSET>)#
Set multiple properties at once.
a.set(a=A, b=B, c=C)
is equivalent to
a.set_a(A) a.set_b(B) a.set_c(C)
In addition to the full property names, aliases are also supported, e.g.
set(lw=2)is equivalent toset(linewidth=2), but it is an error to pass both simultaneously.The order of the individual setter calls matches the order of parameters in
set(). However, most properties do not depend on each other so that order is rarely relevant.Supported properties are
- Properties:
agg_filter: a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image alpha: float or 2D array-like or None animated: bool array: array-like clim: (vmin: float, vmax: float) clip_box:
BboxBaseor None clip_on: bool clip_path: Patch or (Path, Transform) or None cmap:Colormapor str or None data: array-like orPIL.Image.Imageextent: 4-tuple of float figure:FigureorSubFigurefilternorm: bool filterrad: positive float gid: str in_layout: bool interpolation: {‘auto’, ‘nearest’, ‘bilinear’, ‘bicubic’, ‘spline16’, ‘spline36’, ‘hanning’, ‘hamming’, ‘hermite’, ‘kaiser’, ‘quadric’, ‘catrom’, ‘gaussian’, ‘bessel’, ‘mitchell’, ‘sinc’, ‘lanczos’, ‘none’} or None interpolation_stage: {‘data’, ‘rgba’, ‘auto’}, default: image.interpolation_stage label: object mouseover: bool norm:Normalizeor str or None path_effects: list ofAbstractPathEffectpicker: None or bool or float or callable rasterized: bool resample: bool, default: image.resample sketch_params: (scale: float, length: float, randomness: float) snap: bool or None transform:Transformurl: str visible: bool zorder: float