ContourGenerator#
- class contourpy.ContourGenerator#
Abstract base class for contour generator classes, defining the interface that they all implement.
- class property default_fill_type#
Return the default
FillTypeused by this algorithm.
- class property default_line_type#
Return the default
LineTypeused by this algorithm.
- property chunk_count#
Return tuple of (y, x) chunk counts.
- property chunk_size#
Return tuple of (y, x) chunk sizes.
- property corner_mask#
Return whether
corner_maskis set or not.
- property fill_type#
Return the
FillType.
- filled(self: object, lower_level: float, upper_level: float) tuple#
Calculate and return filled contours between two levels.
- Parameters:
lower_level (float) – Lower z-level of the filled contours.
upper_level (float) – Upper z-level of the filled contours.
- Returns:
Filled contour polygons as one or more sequences of numpy arrays. The exact format is determined by the
fill_typeused by theContourGenerator.
Raises a
ValueErroriflower_level >= upper_level.To return filled contours below a
levelusefilled(-np.inf, level). To return filled contours above alevelusefilled(level, np.inf)
- property line_type#
Return the
LineType.
- lines(self: object, level: float) tuple#
Calculate and return contour lines at a particular level.
- Parameters:
level (float) – z-level to calculate contours at.
- Returns:
Contour lines (open line strips and closed line loops) as one or more sequences of numpy arrays. The exact format is determined by the
line_typeused by theContourGenerator.
- property quad_as_tri#
Return whether
quad_as_triis set or not.
- static supports_corner_mask() bool#
Return whether this algorithm supports
corner_mask.
- static supports_fill_type(fill_type: contourpy._contourpy.FillType) bool#
Return whether this algorithm supports a particular
FillType.
- static supports_line_type(line_type: contourpy._contourpy.LineType) bool#
Return whether this algorithm supports a particular
LineType.
- static supports_quad_as_tri() bool#
Return whether this algorithm supports
quad_as_tri.
- static supports_threads() bool#
Return whether this algorithm supports the use of threads.
- static supports_z_interp() bool#
Return whether this algorithm supports
z_interpvalues other thanZInterp.Linearwhich all support.
- property thread_count#
Return the number of threads used.
- property z_interp#
Return the
ZInterp.
- class contourpy.Mpl2005ContourGenerator#
Bases:
ContourGeneratorContourGenerator corresponding to
name="mpl2005".This is the original 2005 Matplotlib algorithm. Does not support any of
corner_mask,quad_as_tri,threadsorz_interp. Only supportsline_type=LineType.SeparateCodeandfill_type=FillType.OuterCode. Only supports chunking for filled contours, not contour lines.Warning
This algorithm is in
contourpyfor historic comparison. No new features or bug fixes will be added to it, except for security-related bug fixes.
- class contourpy.Mpl2014ContourGenerator#
Bases:
ContourGeneratorContourGenerator corresponding to
name="mpl2014".This is the 2014 Matplotlib algorithm, a replacement of the original 2005 algorithm that added
corner_maskand made the code more maintainable. Only supportscorner_mask, does not supportquad_as_tri,threadsorz_interp. Only supportsline_type=LineType.SeparateCodeandfill_type=FillType.OuterCode.Warning
This algorithm is in
contourpyfor historic comparison. No new features or bug fixes will be added to it, except for security-related bug fixes.
- class contourpy.SerialContourGenerator#
Bases:
ContourGeneratorContourGenerator corresponding to
name="serial", the default algorithm forcontourpy.Supports
corner_mask,quad_as_triandz_interpbut notthreads. Supports all options forline_typeandfill_type.
- class contourpy.ThreadedContourGenerator#
Bases:
ContourGeneratorContourGenerator corresponding to
name="threaded", the multithreaded version ofSerialContourGenerator.Supports
corner_mask,quad_as_triandz_interpandthreads. Supports all options forline_typeandfill_type.