Last active
May 16, 2021 17:29
-
-
Save Aditya1001001/8226a5adc34455de69f1ad1fdf8385e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
from mpl_toolkits.mplot3d import Axes3D | |
from matplotlib import cm | |
import numpy as np | |
fig = plt.figure() | |
ax = fig.gca(projection='3d') # Create the axes | |
# Data | |
X = np.linspace(-8, 8, 100) | |
Y = np.linspace(-4, 4, 100) | |
X, Y = np.meshgrid(X, Y) | |
Z = X**2 + Y**2 | |
# Plot the 3d surface | |
surface = ax.plot_surface(X, Y, Z, | |
cmap=cm.coolwarm, | |
rstride = 2, | |
cstride = 2) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment