xoa.core.plot

xoa.core.plot#

Low level plotting routines

These routines work on numpy arrays and matplotlib axes, and know nothing about xarray objects or meta specifications. They are used by the high level plotting functions of the xoa.plot module.

Functions

add_colorbar(mappable[, ax])

Add a colorbar that is shrunk by default

add_compass(ax[, loc, size, style, pad, ...])

Add a compass to a map

add_fancy_map_frame(ax[, width, sides, ...])

Add a black and white alternating frame to a map, like GMT does

add_land(ax[, scale, color])

Add the land to a cartopy axes

add_layer(ax[, name, alpha, zorder, ...])

Add a background layer from a web map service to a cartopy axes

add_quiverkey(ax, quiver, value[, units, pos])

Add a reference arrow, labelled with its value, above the left corner of the axes

add_scalebar(ax[, length, units, loc, pad, ...])

Add a scale bar to a map

cov2ellipse(ustd, vstd, uvcorr)

Get the ellipses that are described by 2x2 covariance matrices

create_base_map(extent[, figsize, ...])

Former names of create_map() and decorate_map()

create_map(extent[, figsize, projection, ...])

Create a decorated cartopy map

decorate_map(ax[, extent, transform, ...])

Decorate a cartopy axes

get_layer([name])

Get the definition of a background layer from the layers options

get_layer_projection([layer])

Get the projection of a map that suits its background layer

get_mesh(lon, lat[, stride])

Get the edges and centers of a grid for plotting, possibly under-sampled

get_projection([projection, extent])

Get a cartopy projection from its name or alias

get_quiverkey_value(speed[, percentile])

Get a round reference value for a quiver key

get_sampled_indices(n, stride)

Get evenly spread indices from 0 to n-1, about every stride

get_scalebar_length(max_length)

Get the longest round length that is not above a maximal length

get_stick_scale(u, v[, length, percentile])

Get the quiver scale of sticks so that the strong ones span a fraction of the axes width

get_strides(stride, lon, lat[, ax, ...])

Get the under-sampling strides along y and x

get_webmercator_pixels(lon, lat, zoom[, ...])

Get the pixel coordinates of points on a web map at a zoom level

import_cartopy()

Import cartopy lazily, with an explicit error message when it is missing

plot_box(ax, lon, lat[, transform, npts])

Plot a box of longitudes and latitudes, like the one of get_geosel()

plot_circle(ax, lon, lat, radius[, ...])

Plot a circle of great circle distance, like the one of get_geosel()

plot_depth_section(ax, x, z, data[, method, ...])

Plot a vertical section from arrays

plot_mesh(ax, lon, lat[, stride, ...])

Plot the edges and centers of a grid

plot_polygon(ax, polygon[, transform])

Plot a polygon, like the one of get_geosel()

plot_rose(direction, value[, nsector, ...])

Plot a rose of the frequencies of a direction and a value

plot_sticks(ax, x, u, v[, scale, color])

Plot vectors as sticks anchored at y=0

plot_taylor(std, corr[, ref_std, diagram])

Plot points in a Taylor diagram

plot_vector_ellipses(ax, quiver, ustd[, ...])

Add uncertainty ellipses at the tip of the arrows of a quiver

plot_vectors(ax, lon, lat, u, v[, stride, ...])

Plot vectors on a grid as arrows, possibly under-sampled

setup_map_axes(ax[, extent, transform, ...])

Decorate a cartopy axes

Classes

QuiverEllipses(quiver, ustd[, vstd, uvcorr, ...])

Ellipses at the tip of the arrows of a quiver

Rose([fig, subplot, rmax, rlabel_angle, ...])

A rose of frequencies on a polar axes

TaylorDiagram([fig, subplot, ref_std, rmax, ...])

A Taylor diagram on a polar axes