Shaded area below curve in 3D projection

47 views Asked by At

I am trying to do the graph, but I want to shade the area below the graph to to reach the (x,y)--plane. So I just want shaded plane along the z-axis. On my plot I can see, that this 'shading' is just a line along my plot, not the shade below the curve.

import numpy as np
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d.art3d import Poly3DCollection # New
import from matplotlib
import colors as mcolors

x = np.arange(-3, 3, 0.01) y = x z = 0.05*np.ones(len(x))

fig = plt.figure(figsize=(10,10))

ax1 = fig.add_subplot(121, projection='3d')

plt.plot(x, z, y, linewidth=4, color='darkgreen', linestyle='solid')

verts = [(x[i], z[i], y[i]) for i in range(len(x))]
ax1.add_collection3d(Poly3DCollection([verts],color='mediumseagreen', alpha=0.6) 
0

There are 0 answers