cartopy.mpl.feature_artist.FeatureArtist#

class cartopy.mpl.feature_artist.FeatureArtist(feature, **kwargs)[source]#

Bases: Collection

A subclass of Collection capable of drawing a cartopy.feature.Feature.

Parameters:
  • feature – An instance of cartopy.feature.Feature to draw.

  • styler – A callable that given a geometry, returns matplotlib styling parameters.

  • **kwargs – Keyword arguments to be used when drawing the feature. These will override those shared with the feature.

draw(renderer)[source]#

Draw the geometries of the feature that intersect with the extent of the cartopy.mpl.geoaxes.GeoAxes instance to which this object has been added.

set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, array=<UNSET>, capstyle=<UNSET>, clim=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, cmap=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, gid=<UNSET>, hatch=<UNSET>, hatch_linewidth=<UNSET>, hatchcolor=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, mouseover=<UNSET>, norm=<UNSET>, offset_transform=<UNSET>, offsets=<UNSET>, path_effects=<UNSET>, paths=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, urls=<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 to set(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: array-like or float or None animated: bool antialiased or aa or antialiaseds: bool or list of bools array: array-like or None capstyle: CapStyle or {‘butt’, ‘projecting’, ‘round’} clim: (vmin: float, vmax: float) clip_box: BboxBase or None clip_on: bool clip_path: Patch or (Path, Transform) or None cmap: Colormap or str or None color: color or list of RGBA tuples edgecolor or ec or edgecolors: color or list of color or ‘face’ facecolor or facecolors or fc: unknown figure: Figure or SubFigure gid: str hatch: {‘/’, ‘\’, ‘|’, ‘-’, ‘+’, ‘x’, ‘o’, ‘O’, ‘.’, ‘*’} hatch_linewidth: unknown hatchcolor: color or list of color or ‘edge’ in_layout: bool joinstyle: JoinStyle or {‘miter’, ‘round’, ‘bevel’} label: object linestyle or dashes or linestyles or ls: {‘-’, ‘–’, ‘-.’, ‘:’, ‘’, …} or (offset, on-off-seq) or list thereof linewidth or linewidths or lw: float or list of floats mouseover: bool norm: Normalize or str or None offset_transform or transOffset: Transform offsets: (N, 2) or (2,) array-like path_effects: list of AbstractPathEffect paths: unknown picker: None or bool or float or callable pickradius: float rasterized: bool sketch_params: (scale: float, length: float, randomness: float) snap: bool or None transform: Transform url: str urls: list of str or None visible: bool zorder: float

set_facecolor(c)[source]#

Set the facecolor(s) of the FeatureArtist. If set to ‘never’ then subsequent calls will have no effect. Otherwise works the same as matplotlib.collections.Collection.set_facecolor.