plot_3d_sin 1¶

Query¶

import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

"""
Create matrix of ones
"""
a = np.ones((5,10))
# end

# plot a 3d sin wave

Output¶

import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

"""
Create matrix of ones
"""
a = np.ones((5,10))
# end

# plot a 3d sin wave
x = np.linspace(0, 2 * np.pi, 100)
y = np.linspace(0, 2 * np.pi, 100).reshape(-1, 1)
z = np.sin(x) + np.cos(y)

fig = plt.figure()
ax = plt.axes(projection='3d')
ax.plot_surface(x, y, z, cmap='viridis')

plt.savefig('/tmp/test.png')

Evaluate¶

Go to Google Form