Matplotlib: How to get Binomial Likelihood Function

Viewed 154

I'm trying to replicate a plot that I've found here: enter image description here

However, I'm struggling with the y-scale of the Likelihood function, i.e. binom(n=10, k=4). I'm using this code:

import matplotlib.pyplot as plt
from scipy.stats import binom
fig, ax = plt.subplots(nrows=1, ncols=1)
x = np.linspace(0, 1, 1000)
ax.plot(x, binom.pmf(n=10, k=4, p=x))

However, this gives me the following plot: enter image description here

We clearly see that the x-axis matches between both plots - however, in the first plot, the blue line suggest a value around 2.5 for x=0.4. Is ist just scaled by a factor to increase readability?

0 Answers
Related