Tri-Surface Plot in Python using Matplotlib Last Updated : 12 Jul, 2025 Comments Improve Suggest changes Like Article Like Report A Tri-Surface Plot is a type of surface plot, created by triangulation of compact surfaces of finite number of triangles which cover the whole surface in a manner that each and every point on the surface is in triangle. The intersection of any two triangles results in void or a common edge or vertex. This type of plot is created where the evenly sampled grids are restrictive and inconvenient to plot. Generally Tri-Surface plots are created by calling ax.plot_trisurf() function of matplotlib library. Some of the attributes of the function are listed below: AttributeParameterX, Y, Zdataset as 1D array to be plottedcolorscolor of the surface patchescmapcolor map to set the color of surface patchesnormparameter to normalize map values of colorsvminminimum value of mapvamxmaximum value of mapshadeattribute to shade the facecolors Example 1: Let's create a basic Tri-Surface plot using the ax.plot_trisurf() function. Python3 # Import libraries from mpl_toolkits import mplot3d import numpy as np import matplotlib.pyplot as plt # Creating dataset z = np.linspace(0, 50000, 100) x = np.sin(z) y = np.cos(z) # Creating figure fig = plt.figure(figsize =(14, 9)) ax = plt.axes(projection ='3d') # Creating plot ax.plot_trisurf(x, y, z, linewidth = 0.2, antialiased = True); # show plot plt.show() Output : Example 2 : For better understanding Let's take another example. Python3 # Import libraries from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np # Creating radii and angles r = np.linspace(0.125, 1.0, 100) a = np.linspace(0, 2 * np.pi, 100, endpoint = False) # Repeating all angles for every radius a = np.repeat(a[..., np.newaxis], 100, axis = 1) # Creating dataset x = np.append(0, (r * np.cos(a))) y = np.append(0, (r * np.sin(a))) z = (np.sin(x ** 4) + np.cos(y ** 4)) # Creating figure fig = plt.figure(figsize =(16, 9)) ax = plt.axes(projection ='3d') # Creating color map my_cmap = plt.get_cmap('hot') # Creating plot trisurf = ax.plot_trisurf(x, y, z, cmap = my_cmap, linewidth = 0.2, antialiased = True, edgecolor = 'grey') fig.colorbar(trisurf, ax = ax, shrink = 0.5, aspect = 5) ax.set_title('Tri-Surface plot') # Adding labels ax.set_xlabel('X-axis', fontweight ='bold') ax.set_ylabel('Y-axis', fontweight ='bold') ax.set_zlabel('Z-axis', fontweight ='bold') # show plot plt.show() Output: Create Quiz Comment J jeeteshgavande30 Follow 0 Improve J jeeteshgavande30 Follow 0 Improve Article Tags : Python Python-matplotlib Matplotlib Artist-class Explore Python FundamentalsPython Introduction 2 min read Input and Output in Python 4 min read Python Variables 4 min read Python Operators 4 min read Python Keywords 2 min read Python Data Types 8 min read Conditional Statements in Python 3 min read Loops in Python - For, While and Nested Loops 5 min read Python Functions 5 min read Recursion in Python 4 min read Python Lambda Functions 5 min read Python Data StructuresPython String 5 min read Python Lists 4 min read Python Tuples 4 min read Python Dictionary 3 min read Python Sets 6 min read Python Arrays 7 min read List Comprehension in Python 4 min read Advanced PythonPython OOP Concepts 11 min read Python Exception Handling 5 min read File Handling in Python 4 min read Python Database Tutorial 4 min read Python MongoDB Tutorial 3 min read Python MySQL 9 min read Python Packages 10 min read Python Modules 3 min read Python DSA Libraries 15 min read List of Python GUI Library and Packages 3 min read Data Science with PythonNumPy Tutorial - Python Library 3 min read Pandas Tutorial 4 min read Matplotlib Tutorial 5 min read Python Seaborn Tutorial 3 min read StatsModel Library - Tutorial 3 min read Learning Model Building in Scikit-learn 6 min read TensorFlow Tutorial 2 min read PyTorch Tutorial 6 min read Web Development with PythonFlask Tutorial 8 min read Django Tutorial | Learn Django Framework 7 min read Django ORM - Inserting, Updating & Deleting Data 4 min read Templating With Jinja2 in Flask 6 min read Django Templates 5 min read Build a REST API using Flask - Python 3 min read Building a Simple API with Django REST Framework 3 min read Python PracticePython Quiz 1 min read Python Coding Practice 1 min read Python Interview Questions and Answers 15+ min read Like