Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé
Classe « Axes »

Méthode matplotlib.axes.Axes.bar_label

Signature de la méthode bar_label

def bar_label(self, container, labels=None, *, fmt='%g', label_type='edge', padding=0, **kwargs) 

Description

help(Axes.bar_label)

Label a bar plot.

Adds labels to bars in the given `.BarContainer`.
You may need to adjust the axis limits to fit the labels.

Parameters
----------
container : `.BarContainer`
    Container with all the bars and optionally errorbars, likely
    returned from `.bar` or `.barh`.

labels : array-like, optional
    A list of label texts, that should be displayed. If not given, the
    label texts will be the data values formatted with *fmt*.

fmt : str or callable, default: '%g'
    An unnamed %-style or {}-style format string for the label or a
    function to call with the value as the first argument.
    When *fmt* is a string and can be interpreted in both formats,
    %-style takes precedence over {}-style.

    .. versionadded:: 3.7
       Support for {}-style format string and callables.

label_type : {'edge', 'center'}, default: 'edge'
    The label type. Possible values:

    - 'edge': label placed at the end-point of the bar segment, and the
      value displayed will be the position of that end-point.
    - 'center': label placed in the center of the bar segment, and the
      value displayed will be the length of that segment.
      (useful for stacked bars, i.e.,
      :doc:`/gallery/lines_bars_and_markers/bar_label_demo`)

padding : float, default: 0
    Distance of label from the end of the bar, in points.

**kwargs
    Any remaining keyword arguments are passed through to
    `.Axes.annotate`. The alignment parameters (
    *horizontalalignment* / *ha*, *verticalalignment* / *va*) are
    not supported because the labels are automatically aligned to
    the bars.

Returns
-------
list of `.Annotation`
    A list of `.Annotation` instances for the labels.


Vous êtes un professionnel et vous avez besoin d'une formation ? Mise en oeuvre d'IHM
avec Qt et PySide6
Voir le programme détaillé