I am trying to plot a function in a way similar to the one shown in the figure in the link:
The equation in which this plot is based on is: y= sin^2θ x /(e^x +1)
I have previously plotted the equation above without the sine function, using the following code:
# Generate some data.
x = np.logspace(-1, 3, 100)
y= x * 1/ (np.exp(x) + 1)
plt.loglog(x, y)
plt.autoscale(enable=True, axis='x', tight=True) # optionally set a tight x-axis
#adding labels to axis
plt.xlabel('y=E/T')
plt.ylabel('$f_s$')
plt.show()
But how can I plot this function with a varying sin function. I have tried applying what was used in the following link but I don't understand the code: How can I convert numbers to a color scale in matplotlib?
I am new to python and the code has barely any description in it.
I have also tried to apply the method shown in How do I plot a function with different values of a parameter on the same plot in gnuplot 4.4? but I keep on getting the same error message, "Invalid synthax pyplate E"