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 ? Programmation Python
Les compléments
Voir le programme détaillé
Module « matplotlib.pyplot »

Fonction tripcolor - module matplotlib.pyplot

Signature de la fonction tripcolor

def tripcolor(*args, alpha=1.0, norm=None, cmap=None, vmin=None, vmax=None, shading='flat', facecolors=None, **kwargs) 

Description

help(matplotlib.pyplot.tripcolor)

Create a pseudocolor plot of an unstructured triangular grid.

Call signatures::

  tripcolor(triangulation, c, *, ...)
  tripcolor(x, y, c, *, [triangles=triangles], [mask=mask], ...)

The triangular grid can be specified either by passing a `.Triangulation`
object as the first parameter, or by passing the points *x*, *y* and
optionally the *triangles* and a *mask*. See `.Triangulation` for an
explanation of these parameters.

It is possible to pass the triangles positionally, i.e.
``tripcolor(x, y, triangles, c, ...)``. However, this is discouraged.
For more clarity, pass *triangles* via keyword argument.

If neither of *triangulation* or *triangles* are given, the triangulation
is calculated on the fly. In this case, it does not make sense to provide
colors at the triangle faces via *c* or *facecolors* because there are
multiple possible triangulations for a group of points and you don't know
which triangles will be constructed.

Parameters
----------
triangulation : `.Triangulation`
    An already created triangular grid.
x, y, triangles, mask
    Parameters defining the triangular grid. See `.Triangulation`.
    This is mutually exclusive with specifying *triangulation*.
c : array-like
    The color values, either for the points or for the triangles. Which one
    is automatically inferred from the length of *c*, i.e. does it match
    the number of points or the number of triangles. If there are the same
    number of points and triangles in the triangulation it is assumed that
    color values are defined at points; to force the use of color values at
    triangles use the keyword argument ``facecolors=c`` instead of just
    ``c``.
    This parameter is position-only.
facecolors : array-like, optional
    Can be used alternatively to *c* to specify colors at the triangle
    faces. This parameter takes precedence over *c*.
shading : {'flat', 'gouraud'}, default: 'flat'
    If  'flat' and the color values *c* are defined at points, the color
    values used for each triangle are from the mean c of the triangle's
    three points. If *shading* is 'gouraud' then color values must be
    defined at points.
cmap : str or `~matplotlib.colors.Colormap`, default: :rc:`image.cmap`
    The Colormap instance or registered colormap name used to map scalar data
    to colors.

norm : str or `~matplotlib.colors.Normalize`, optional
    The normalization method used to scale scalar data to the [0, 1] range
    before mapping to colors using *cmap*. By default, a linear scaling is
    used, mapping the lowest value to 0 and the highest to 1.

    If given, this can be one of the following:

    - An instance of `.Normalize` or one of its subclasses
      (see :ref:`colormapnorms`).
    - A scale name, i.e. one of "linear", "log", "symlog", "logit", etc.  For a
      list of available scales, call `matplotlib.scale.get_scale_names()`.
      In that case, a suitable `.Normalize` subclass is dynamically generated
      and instantiated.

vmin, vmax : float, optional
    When using scalar data and no explicit *norm*, *vmin* and *vmax* define
    the data range that the colormap covers. By default, the colormap covers
    the complete value range of the supplied data. It is an error to use
    *vmin*/*vmax* when a *norm* instance is given (but using a `str` *norm*
    name together with *vmin*/*vmax* is acceptable).

colorizer : `~matplotlib.colorizer.Colorizer` or None, default: None
    The Colorizer object used to map color to data. If None, a Colorizer
    object is created from a *norm* and *cmap*.

Returns
-------
`~matplotlib.collections.PolyCollection` or `~matplotlib.collections.TriMesh`
    The result depends on *shading*: For ``shading='flat'`` the result is a
    `.PolyCollection`, for ``shading='gouraud'`` the result is a `.TriMesh`.

Other Parameters
----------------
**kwargs : `~matplotlib.collections.Collection` properties

    Properties:
    agg_filter: a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image
    alpha: array-like or scalar or None
    animated: bool
    antialiased or aa or antialiaseds: bool or list of bools
    array: array-like or None
    capstyle: `.CapStyle` or {'butt', 'projecting', 'round'}
    clim: (vmin: float, vmax: float)
    clip_box: `~matplotlib.transforms.BboxBase` or None
    clip_on: bool
    clip_path: Patch or (Path, Transform) or None
    cmap: `.Colormap` or str or None
    color: :mpltype:`color` or list of RGBA tuples
    edgecolor or ec or edgecolors: :mpltype:`color` or list of :mpltype:`color` or 'face'
    facecolor or facecolors or fc: :mpltype:`color` or list of :mpltype:`color`
    figure: `~matplotlib.figure.Figure` or `~matplotlib.figure.SubFigure`
    gid: str
    hatch: {'/', '\\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
    hatch_linewidth: unknown
    in_layout: bool
    joinstyle: `.JoinStyle` or {'miter', 'round', 'bevel'}
    label: object
    linestyle or dashes or linestyles or ls: str or tuple or list thereof
    linewidth or linewidths or lw: float or list of floats
    mouseover: bool
    norm: `.Normalize` or str or None
    offset_transform or transOffset: `.Transform`
    offsets: (N, 2) or (2,) array-like
    path_effects: list of `.AbstractPathEffect`
    paths: unknown
    picker: None or bool or float or callable
    pickradius: float
    rasterized: bool
    sketch_params: (scale: float, length: float, randomness: float)
    snap: bool or None
    transform: `~matplotlib.transforms.Transform`
    url: str
    urls: list of str or None
    visible: bool
    zorder: float

Notes
-----

.. note::

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


Vous êtes un professionnel et vous avez besoin d'une formation ? Machine Learning
avec Scikit-Learn
Voir le programme détaillé