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 ? Sensibilisation à
l'Intelligence Artificielle
Voir le programme détaillé
Module « matplotlib.pyplot »

Fonction stem - module matplotlib.pyplot

Signature de la fonction stem

def stem(*args: 'ArrayLike | str', linefmt: 'str | None' = None, markerfmt: 'str | None' = None, basefmt: 'str | None' = None, bottom: 'float' = 0, label: 'str | None' = None, orientation: "Literal['vertical', 'horizontal']" = 'vertical', data=None) -> 'StemContainer' 

Description

help(matplotlib.pyplot.stem)

Create a stem plot.

A stem plot draws lines perpendicular to a baseline at each location
*locs* from the baseline to *heads*, and places a marker there. For
vertical stem plots (the default), the *locs* are *x* positions, and
the *heads* are *y* values. For horizontal stem plots, the *locs* are
*y* positions, and the *heads* are *x* values.

Call signature::

  stem([locs,] heads, linefmt=None, markerfmt=None, basefmt=None)

The *locs*-positions are optional. *linefmt* may be provided as
positional, but all other formats must be provided as keyword
arguments.

Parameters
----------
locs : array-like, default: (0, 1, ..., len(heads) - 1)
    For vertical stem plots, the x-positions of the stems.
    For horizontal stem plots, the y-positions of the stems.

heads : array-like
    For vertical stem plots, the y-values of the stem heads.
    For horizontal stem plots, the x-values of the stem heads.

linefmt : str, optional
    A string defining the color and/or linestyle of the vertical lines:

    =========  =============
    Character  Line Style
    =========  =============
    ``'-'``    solid line
    ``'--'``   dashed line
    ``'-.'``   dash-dot line
    ``':'``    dotted line
    =========  =============

    Default: 'C0-', i.e. solid line with the first color of the color
    cycle.

    Note: Markers specified through this parameter (e.g. 'x') will be
    silently ignored. Instead, markers should be specified using
    *markerfmt*.

markerfmt : str, optional
    A string defining the color and/or shape of the markers at the stem
    heads. If the marker is not given, use the marker 'o', i.e. filled
    circles. If the color is not given, use the color from *linefmt*.

basefmt : str, default: 'C3-' ('C2-' in classic mode)
    A format string defining the properties of the baseline.

orientation : {'vertical', 'horizontal'}, default: 'vertical'
    The orientation of the stems.

bottom : float, default: 0
    The y/x-position of the baseline (depending on *orientation*).

label : str, optional
    The label to use for the stems in legends.

data : indexable object, optional
    If given, all parameters also accept a string ``s``, which is
    interpreted as ``data[s]`` if ``s`` is a key in ``data``.

Returns
-------
`.StemContainer`
    The container may be treated like a tuple
    (*markerline*, *stemlines*, *baseline*)

Notes
-----

.. note::

    This is the :ref:`pyplot wrapper <pyplot_interface>` for `.axes.Axes.stem`.

.. seealso::
    The MATLAB function
    `stem <https://www.mathworks.com/help/matlab/ref/stem.html>`_
    which inspired this method.


Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les compléments
Voir le programme détaillé