graphinglib.Contour.__init__#

Contour.__init__(z_data: ArrayLike, x_mesh: TypeAliasForwardRef('ArrayLike') | None = None, y_mesh: TypeAliasForwardRef('ArrayLike') | None = None, levels: int | TypeAliasForwardRef('ArrayLike') | Inherit = Inherit, color_map: str | Colormap | Inherit = Inherit, color_map_range: tuple[float, float] | None = None, show_color_bar: bool | Inherit = Inherit, filled: bool | Inherit = Inherit, alpha: float | Inherit = Inherit, line_widths: float | TypeAliasForwardRef('ArrayLike') | Inherit = Inherit) None[source]#

This class implements contour plots.

Parameters:
z_dataArrayLike

Data for each point of the mesh.

x_mesh, y_meshArrayLike, optional

Mesh grids defining the coordinates of the contour values. If not provided, a mesh grid will be created based on the shape of z_data.

levelsint | ArrayLike

If levels is an integer, it defines the number of levels to use in the contour. If levels is an array, it defines the value of each contour level. Typical range is 5 to 20 when given as an integer. Default depends on the figure_style configuration.

color_mapstr or Colormap

The color map to use for the Contour. Can either be specified as a string (named colormap from Matplotlib) or a Colormap object. Examples include "viridis", "plasma", and "coolwarm". Default depends on the figure_style configuration.

color_map_range: tuple[float, float], optional

The data range covered by the color map, given as (minimum, maximum).

show_color_barbool

Whether or not to display the color bar next to the plot. Default depends on the figure_style configuration.

filledbool

Wheter or not to fill the contour with color. Default depends on the figure_style configuration.

alphafloat

Opacity of the filled contour. Range is 0 (transparent) to 1 (opaque). Default depends on the figure_style configuration.

line_widthsfloat | ArrayLike

If the contour is not filled, the width of the contour lines. If an array is provided, it defines the line width for each contour level. Typical range is 0.5 to 3 points. Default depends on the figure_style configuration.