indicate_contours#
- ColorBar.indicate_contours(contour_map=None, add_labels='top', use_levels=None, exclude_levels=None, colors=None, linewidths=None, linestyles=None, label_names=None, label_precision=4, label_kwargs=None)#
Indicate contour locations in the colorbar.
Note: Before using this function you must draw a dataset with the
contour
shape! (you can also indicate contours from other Maps-objects by using the optionalcontour_map
argument.)- Parameters:
contour_map (eomaps.Maps, optional) – The maps object whose contours should be indicated. If None, the Maps-object associated with this colorbar is used. The default is None.
add_labels (str, float or None, optional) –
“bottom”: add labels at the bottom of the colorbar
”top”: add labels to the top of the colorbar histogram
If float: The relative position of the label in axis-coordinates (0-1)
None: don’t add labels
The default is “bottom”.
rotation (float, optional) – The rotation of the labels (in degrees). The default is 90.
use_levels –
A list of integers that specify levels that should be used. (negative values count from right)
If None, all values are used.
For example, to draw the first and 3rd level and name them “A” and “B”, use:
>>> cb.indicate_contours(use_levels = [-1, 2], label_names=["A", "B"])
- exclude_levelslist of int, optional
Only relevant if “use_levels” is None! A list of integers that specify levels that should be ignored. (negative values count from right)
By default, the last level are ignored, e.g.:
>>> exclude_levels = [-1]
- colorsstr or list, optional
Custom colors that will be used for the lines. NOTE: If less values than levels are specified, values are cycled!
If None, the contour-colors are used. The default is None.
- linewidthsfloat or list, optional
Custom linewidths that will be used for the lines. NOTE: If less values than levels are specified, values are cycled!
If None, the contour-linewidths are used. The default is None.
- linestylesfloat, tuple or list, optional
Custom linestyles that will be used for the lines. NOTE: If less values than levels are specified, values are cycled!
If None, the contour-linestyles are used. The default is None.
- label_kwargsdict
Additional kwargs passed to the creation of the labels.
Font-properties like “fontsize”, “fontweight”, “rotation”, etc..
To offset the text (in points) from the xy value, use “xytext”.
To add an arrow, use “arrowprops”.
For more details, see
plt.annotate
.The default is:
>>> {fontsize: "x-small", >>> textcoords: "offset points" >>> xytext: (0, 0)}