Answers for "matplotlib three dimensional plot"

0

matplotlib three dimensional plot

ax = plt.axes(projection='3d')

# Data for a three-dimensional line
zline = np.linspace(0, 15, 1000)
xline = np.sin(zline)
yline = np.cos(zline)
ax.plot3D(xline, yline, zline, 'gray')

# Data for three-dimensional scattered points
zdata = 15 * np.random.random(100)
xdata = np.sin(zdata) + 0.1 * np.random.randn(100)
ydata = np.cos(zdata) + 0.1 * np.random.randn(100)
ax.scatter3D(xdata, ydata, zdata, c=zdata, cmap='Greens');
Posted by: Guest on June-29-2021
0

matplotlib three dimensional plot

%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
Posted by: Guest on June-29-2021
0

matplotlib three dimensional plot

def f(x, y):
    return np.sin(np.sqrt(x ** 2 + y ** 2))

x = np.linspace(-6, 6, 30)
y = np.linspace(-6, 6, 30)

X, Y = np.meshgrid(x, y)
Z = f(X, Y)
Posted by: Guest on June-29-2021
0

matplotlib three dimensional plot

fig = plt.figure()
ax = plt.axes(projection='3d')
Posted by: Guest on June-29-2021
-1

matplotlib three dimensional plot

from mpl_toolkits import mplot3d
Posted by: Guest on January-12-2021

Browse Popular Code Answers by Language