import numpy as np import matplotlib.pyplot as plt # t will be a list with elements 0, .02, .04,..., 1 t = np.linspace(0, 1, 51) plt.plot(t, dfunc(t), color = "red")Here the first argument of the function plot is the list of the values of the domain, and the second argument contains the values of the function at these points, where dfunc have to be defined before.
plt.hist(experiments, bins=t, density=1)