geocat.viz.util.plotCLabels

Contents

geocat.viz.util.plotCLabels#

geocat.viz.util.plotCLabels(ax, contours, transform, proj, clabel_locations=[], fontsize=12, whitebbox=False, horizontal=False)#

Deprecated since version 2023.02.0: The plotCLabels function is deprecated due to naming conventions. Use plot_contour_levels() instead.

Utility function to plot contour labels by passing in a coordinate to the clabel function.

This allows the user to specify the exact locations of the labels, rather than having matplotlib plot them automatically.

Parameters:
  • ax (matplotlib.axes.Axes) – Axis containing the contour set.

  • contours (matplotlib.contour.QuadContourSet) – Contour set that is being labeled.

  • transform (cartopy.crs.CRS) – Instance of CRS that represents the source coordinate system of coordinates. (ex. ccrs.Geodetic()).

  • proj (cartopy.crs.CRS) – Projection ‘ax’ is defined by. This is the instance of CRS that the coordinates will be transformed to.

  • clabel_locations (list) – List of coordinate tuples in GPS form (lon in degrees, lat in degrees) that specify where the contours with regular field variable values should be plotted.

  • fontsize (int) – Font size of contour labels.

  • whitebbox (bool) – Setting this to “True” will cause all labels to be plotted with white backgrounds

  • horizontal (bool) – Setting this to “True” will cause the contour labels to be horizontal.

Returns:

cLabels (list) – List of text instances of all contour labels

Examples

All usage examples are within the GeoCAT-Examples Gallery. To see more usage cases, search the function on the website.