layers

Classes

Layer

A single plot Layer on a Subplot.

LayerGroup

A group of related layers.

Module Contents

class layers.Layer(source, mappable, subplot, style=None)

A single plot Layer on a Subplot.

Parameters:
  • source (earthkit.maps.sources.Source) – The source of the data to be plotted.

  • mappable (matplotlib object) – The object that is plotted on the axes.

  • subplot (earthkit.plots.components.subplots.Subplot) – The subplot on which this layer is plotted.

  • style (earthkit.plots.styles.Style, optional) – The style to be applied to this layer.

property ax
The matplotlib axes on which this layer is plotted.
property axes
All matplotlib axes over which this layer is plotted.
property fig
The matplotlib figure on which this layer is plotted.
format_string(string)
legend(*args, **kwargs)

Generate a legend for this specific layer.

mappable
source
style
subplot
class layers.LayerGroup(layers)

A group of related layers.

Parameters:

layers (list of earthkit.maps.charts.layers.Layer objects) – A list of grouped layers.

property axes
All matplotlib axes over which this layer group is plotted.
property fig
The matplotlib figure on which this layer group is plotted.
format_string(string, unique=True)

Format a string with the layer group’s metadata.

Parameters:
  • string (str) – The string to be formatted. Can contain placeholders for the layer group’s metadata in the form of {key}.

  • unique (bool, optional) – Whether to return only unique values for each placeholder. If False, all values will be returned.

layers
legend(*args, **kwargs)

Add a legend for this layer group.

Parameters:
  • *args (list) – Arguments to be passed to the style.legend method.

  • **kwargs (dict) – Keyword arguments to be passed to the style.legend method.

property mappable
The object that is plotted on the axes.
property style
The style to be applied to this layer group.
property subplots
The subplots on which this layer group is plotted.