plots.styles.legends ==================== .. py:module:: plots.styles.legends Attributes ---------- .. autoapisummary:: plots.styles.legends.DEFAULT_LEGEND_LABEL Functions --------- .. autoapisummary:: plots.styles.legends.colorbar plots.styles.legends.disjoint plots.styles.legends.estimate_legend_cols plots.styles.legends.vector Module Contents --------------- .. py:data:: DEFAULT_LEGEND_LABEL :value: '{variable_name} ({units})' .. py:function:: colorbar(layer, *args, shrink=0.8, aspect=35, ax=None, color='black', **kwargs) Produce a colorbar for a given layer. :param layer: The layer for which to produce a colorbar. :type layer: earthkit.maps.charts.layers.Layer :param \*\*kwargs: Any keyword arguments accepted by `matplotlib.figures.Figure.colorbar`. .. py:function:: disjoint(layer, *args, location='bottom', frameon=False, **kwargs) Produce a disjoint legend for a given layer. :param layer: The layer for which to produce a colorbar. :type layer: earthkit.maps.charts.layers.Layer :param \*\*kwargs: Any keyword arguments accepted by `matplotlib.figures.Figure.legend`. .. py:function:: estimate_legend_cols(axes, labels, position='top') Estimates the number of columns for a legend based on the total width or height of a list of axes, the position of the legend, and the lengths of the labels. Args: axes (list of matplotlib.axes.Axes): The list of axes objects to which the legend will be aligned. labels (list of str): The labels for the legend. position (str): Position of the legend, choices are 'top', 'bottom', 'left', 'right'. Returns: int: Estimated number of columns for the legend. .. py:function:: vector(layer, *args, vector_reference=16, **kwargs)