How can I create an interactive plot of the pdf and the cdf of the Continuous Uniform Distribution using python?
I would like to have interactive sliders with which I can adjust the parameters of the distribution.
This is handy for getting a better insight in the behavior of this distribution for different values of its parameters.


1. The simplest way is to use scipy.stats.uniform() to get the pdf and the cdf of the distribution and then using pn.interact() to get the interactive sliders for the parameters:
Resulting interactive plot with sliders:
2. A more extensive and flexible example which allows setting parameter a and b more intuitively: