graphinglib.Contour.from_function#

classmethod Contour.from_function(func: Callable[[ArrayLike, ArrayLike], ArrayLike], x_axis_range: tuple[float, float], y_axis_range: tuple[float, float], number_of_levels: int | Literal['default'] = 'default', color_map: str | Colormap | Literal['default'] = 'default', show_color_bar: bool | Literal['default'] = 'default', filled: bool | Literal['default'] = 'default', alpha: float | Literal['default'] = 'default', number_of_points: tuple[int, int] = (500, 500)) Self[source]#

Creates a Contour object from a function.

Parameters:
funcCallable[[ArrayLike, ArrayLike], ArrayLike]

Function to be plotted. Works with regular functions and lambda functions.

x_mesh, y_meshArrayLike

x and y coordinates of the mesh grid.

z_dataArrayLike

Data for each point of the mesh.

number_of_levelsint

Number of distinct levels of contour plot. Default depends on the figure_style configuration.

color_mapstr or Colormap

The color map to use for the Heatmap. Can either be specified as a string (named colormap from Matplotlib) or a Colormap object. Default depends on the figure_style configuration.

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. Default depends on the figure_style configuration.

Returns:
A Contour object from a function.