Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute.
The Axes.tricontourf() function in axes module of matplotlib library is also used to draw contours on an unstructured triangular grid. tricontour and tricontourf draw contour lines and filled contours, respectively.
Syntax:Axes.tricontourf(ax, *args, **kwargs)
Parameters: This method accept the following parameters that are described below:
- x, y: These parameter are the x and y coordinates of the data which is to be plot.
- triangulation: This parameter is a matplotlib.tri.Triangulation object.
- Z: This parameter is is the array of values to contour, one per point in the triangulation.
- **kwargs: This parameter is Text properties that is used to control the appearance of the labels.
All remaining args and kwargs are the same as for matplotlib.pyplot.plot().
Note: tricontourf-only keyword arguments:
antialiased: This parameter is a bool enable antialiasing which used in contours on an unstructured triangular grid.
Returns: This returns the list of 2 Line2D containing following:
- The lines plotted for triangles edges.
- The markers plotted for triangles nodes
Below examples illustrate the matplotlib.axes.Axes.tricontourf() function in matplotlib.axes:
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.