Plotting graphs with functions in 3D matplotlib

1

Good evening everyone! I need to plot an area chart where the height z varies according to any function and its interval depends on the starting point and the end point reported. I found the example below on the internet but I do not know how to change it so that the chart obeys my imposed conditions. How can I proceed? Thank you in advance.

from mpl_toolkits.mplot3d import Axes3D
from matplotlib.collections import PolyCollection
from matplotlib.colors import colorConverter
import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = fig.gca(projection='3d')
t  = np.arange(1024)*1e-6
y1 = np.sin(t*2e3*np.pi) 
verts=[list(zip(t, y1))]

poly = PolyCollection(verts, facecolors = ['r','g','b'])
poly.set_alpha(0.7)
ax.add_collection3d(poly, zs=zs, zdir='y')
ax.set_xlabel('X')
ax.set_xlim3d(0, 1024e-6)

plt.show()
    
asked by anonymous 10.09.2018 / 00:00

0 answers