theta = [...] # your values of theta you'd like to plot
x = np.linspace(-1, 3, 100) # Or np.logspace, as you want. You'll have to change the parameters though, if you want to display properly
y = x / (np.exp(x)+1)
for t in theta :
plt.plot(x, np.sin(2*t)*y, label = 'theta = %s' % t)
plt.legend()
plt.show()
Результат для theta = [1,2,3]
:
![image1](https://i.stack.imgur.com/YpbWC.png)
If you want to display a colormap, you can do this (code taken from здесь ):
import matplotlib
norm = matplotlib.colors.Normalize(vmin=np.min(theta), vmax=np.max(theta))
c_m = matplotlib.cm.cool
s_m = matplotlib.cm.ScalarMappable(cmap=c_m, norm=norm)
s_m.set_array([])
for t in theta :
plt.plot(x, np.sin(2*t)*y, color=s_m.to_rgba(t))
plt.colorbar(s_m)
plt.show()
Результат:
imageColormap