| [ Web Proxy ] |
| Viewing: https://matplotlib.org/stable/api/_as_gen/../contour_api.html#matplotlib.contour.QuadContourSet | [Back] [Original] |
matplotlib.contour#Classes to support contour plotting and labelling for the Axes class.
Bases: object
Mixin to provide labelling capability to ContourSet.
Add a contour label, respecting whether use_clabeltext was set.
Add a label near the point (x, y).
The approximate location of the label.
If True remove the segment of the contour beneath the label.
Space in pixels to leave on each side of label when placing inline. This spacing will be exact for labels at locations where the contour is straight, less so for labels on curved contours.
Transform or False, default: self.axes.transDataA transform applied to (x, y) before labeling. The default
causes (x, y) to be interpreted as data coordinates. False
is a synonym for IdentityTransform; i.e. (x, y) should be
interpreted as display coordinates.
Label a contour plot.
Adds labels to line contours in this ContourSet (which inherits from
this mixin class).
A list of level values, that should be labeled. The list must be
a subset of cs.levels. If not given, all levels are labeled.
rcParams["font.size"] (default: 10.0)Size in points or relative size e.g., 'small', 'x-large'.
See Text.set_size for accepted string values.
The label colors:
If None, the color of each label matches the color of the corresponding contour.
If one string color, e.g., colors = 'r' or colors = 'red', all labels will be plotted in this color.
If a tuple of colors (string, float, RGB, etc), different labels will be plotted in different colors in the order specified.
If True the underlying contour is removed where the label is
placed.
Space in pixels to leave on each side of label when placing inline.
This spacing will be exact for labels at locations where the contour is straight, less so for labels on curved contours.
Formatter or str or callable or dict, optionalHow the levels are formatted:
If a Formatter, it is used to format all levels at once, using
its Formatter.format_ticks method.
If a str, it is interpreted as a %-style format string.
If a callable, it is called with one level at a time and should return the corresponding label.
If a dict, it should directly map levels to labels.
The default is to use a standard ScalarFormatter.
If True, contour labels will be placed manually using
mouse clicks. Click the first button near a contour to
add a label, click the second button (or potentially both
mouse buttons at once) to finish adding labels. The third
button can be used to remove the last label added, but
only if labels are not inline. Alternatively, the keyboard
can be used to select label locations (enter to end label
placement, delete or backspace act like the third mouse button,
and any other key will select a label location).
manual can also be an iterable object of (x, y) tuples. Contour labels will be created as if mouse is clicked at each (x, y) position.
If True, label rotations will always be plus
or minus 90 degrees from level.
If True, use Text.set_transform_rotates_text to ensure that
label rotation is updated whenever the Axes aspect changes.
(2 + contour.get_zorder())zorder of the contour labels.
A list of Text instances for the labels.
Note: The returned Text instances should not be individually
removed or have their geometry modified, e.g. by changing text or font size.
If you need such a modification, remove the entire
ContourSet and recreate it.
Find good place to draw a label (relatively flat part of the contour).
Bases: ContourLabeler, Collection
Store a set of contour lines or filled regions.
User-callable method: clabel
AxesA list of floating point numbers indicating the contour levels.
List of all the polygon segments for all the levels.
For contour lines len(allsegs) == len(levels), and for
filled contour regions len(allsegs) = len(levels)-1. The lists
should look like
level0segs = [polygon0, polygon1, ...]
polygon0 = [[x0, y0], [x1, y1], ...]
None or [level0kinds, level1kinds, ...]Optional list of all the polygon vertex kinds (code types), as
described and used in Path. This is used to allow multiply-
connected paths such as holes within filled polygons.
If not None, len(allkinds) == len(allsegs). The lists
should look like
level0kinds = [polygon0kinds, ...]
polygon0kinds = [vertexcode0, vertexcode1, ...]
If allkinds is not None, usually all polygons for a
particular contour level are grouped together so that
level0segs = [polygon0] and level0kinds = [polygon0kinds].
Keyword arguments are as described in the docstring of
contour.
The values of the contour levels.
Same as levels for line contours; half-way between
levels for filled contours. See ContourSet._process_colors.
Draw contour lines or filled regions, depending on
whether keyword arg filled is False (default) or True.
Call signature:
ContourSet(ax, levels, allsegs, [allkinds], **kwargs)
AxesThe Axes object to draw on.
A list of floating point numbers indicating the contour levels.
List of all the polygon segments for all the levels.
For contour lines len(allsegs) == len(levels), and for
filled contour regions len(allsegs) = len(levels)-1. The lists
should look like
level0segs = [polygon0, polygon1, ...]
polygon0 = [[x0, y0], [x1, y1], ...]
Optional list of all the polygon vertex kinds (code types), as
described and used in Path. This is used to allow multiply-
connected paths such as holes within filled polygons.
If not None, len(allkinds) == len(allsegs). The lists
should look like
level0kinds = [polygon0kinds, ...]
polygon0kinds = [vertexcode0, vertexcode1, ...]
If allkinds is not None, usually all polygons for a
particular contour level are grouped together so that
level0segs = [polygon0] and level0kinds = [polygon0kinds].
Keyword arguments are as described in the docstring of
contour.
Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (Artist.get_visible
returns False).
RendererBase subclass.Notes
This method is overridden in the Artist subclasses.
Find the point in the contour plot that is closest to (x, y).
This method does not support filled contours.
The reference point.
Indices of contour levels to consider. If None (the default), all levels are considered.
If True, measure distance in pixel (screen) space, which is useful for manual contour labeling; else, measure distance in axes space.
The index of the path that is closest to (x, y). Each path corresponds
to one contour level.
The index within that closest path of the subpath that is closest to
(x, y). Each subpath corresponds to one unbroken contour line.
The index of the vertices within that subpath that are closest to
(x, y).
The point in the contour plot that is closest to (x, y).
The squared distance from (xmin, ymin) to (x, y).
Return a list of artists and labels suitable for passing through
to legend which represent this ContourSet.
The labels have the form "0 < x <= 1" stating the data ranges which the artists represent.
The string used inside the inequality used on the labels.
Function used to format the numbers in the labels.
Artist]A list of the artists.
A list of the labels.
Set multiple properties at once.
a.set(a=A, b=B, c=C)
is equivalent to
a.set_a(A)
a.set_b(B)
a.set_c(C)
In addition to the full property names, aliases are also supported, e.g.
set(lw=2) is equivalent to set(linewidth=2), but it is an error
to pass both simultaneously.
The order of the individual setter calls matches the order of parameters
in set(). However, most properties do not depend on each other so
that order is rarely relevant.
Supported properties are
Property
Description
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
array-like or float or None
bool
antialiasedoraaorantialiasedsbool or list of bools
array-like or None
CapStyleor {'butt', 'projecting', 'round'}(vmin: float, vmax: float)
BboxBaseor Nonebool
Patch or (Path, Transform) or None
Colormapor str or Nonecolor or list of RGBA tuples
edgecolororecoredgecolors
facecolororfacecolorsorfcstr
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
unknown
bool
JoinStyleor {'miter', 'round', 'bevel'}object
linestyleordashesorlinestylesorls{'-', '--', '-.', ':', '', ...} or (offset, on-off-seq) or list thereof
linewidthorlinewidthsorlwfloat or list of floats
bool
Normalizeor str or None(N, 2) or (2,) array-like
list of
AbstractPathEffectunknown
None or bool or float or callable
float
bool
(scale: float, length: float, randomness: float)
bool or None
str
list of str or None
bool
float
Bases: ContourSet
Create and store a set of contour lines or filled regions.
This class is typically not instantiated directly by the user but by
contour and contourf.
The values of the contour levels.
Same as levels for line contours; half-way between
levels for filled contours. See ContourSet._process_colors.
Draw contour lines or filled regions, depending on
whether keyword arg filled is False (default) or True.
Call signature:
ContourSet(ax, levels, allsegs, [allkinds], **kwargs)
AxesThe Axes object to draw on.
A list of floating point numbers indicating the contour levels.
List of all the polygon segments for all the levels.
For contour lines len(allsegs) == len(levels), and for
filled contour regions len(allsegs) = len(levels)-1. The lists
should look like
level0segs = [polygon0, polygon1, ...]
polygon0 = [[x0, y0], [x1, y1], ...]
Optional list of all the polygon vertex kinds (code types), as
described and used in Path. This is used to allow multiply-
connected paths such as holes within filled polygons.
If not None, len(allkinds) == len(allsegs). The lists
should look like
level0kinds = [polygon0kinds, ...]
polygon0kinds = [vertexcode0, vertexcode1, ...]
If allkinds is not None, usually all polygons for a
particular contour level are grouped together so that
level0segs = [polygon0] and level0kinds = [polygon0kinds].
Keyword arguments are as described in the docstring of
contour.
Set multiple properties at once.
a.set(a=A, b=B, c=C)
is equivalent to
a.set_a(A)
a.set_b(B)
a.set_c(C)
In addition to the full property names, aliases are also supported, e.g.
set(lw=2) is equivalent to set(linewidth=2), but it is an error
to pass both simultaneously.
The order of the individual setter calls matches the order of parameters
in set(). However, most properties do not depend on each other so
that order is rarely relevant.
Supported properties are
Property
Description
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
array-like or float or None
bool
antialiasedoraaorantialiasedsbool or list of bools
array-like or None
CapStyleor {'butt', 'projecting', 'round'}(vmin: float, vmax: float)
BboxBaseor Nonebool
Patch or (Path, Transform) or None
Colormapor str or Nonecolor or list of RGBA tuples
edgecolororecoredgecolors
facecolororfacecolorsorfcstr
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
unknown
bool
JoinStyleor {'miter', 'round', 'bevel'}object
linestyleordashesorlinestylesorls{'-', '--', '-.', ':', '', ...} or (offset, on-off-seq) or list thereof
linewidthorlinewidthsorlwfloat or list of floats
bool
Normalizeor str or None(N, 2) or (2,) array-like
list of
AbstractPathEffectunknown
None or bool or float or callable
float
bool
(scale: float, length: float, randomness: float)
bool or None
str
list of str or None
bool
float
| Web Proxy Viewer | New URL | Original Page |