Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can add a list_plot:

reset()
import scipy.stats
n = 2000
p = 0.2
binom_dist = scipy.stats.binom(n,p)
data = [binom_dist.pmf(x) for x in range(n)]
Layout = {'frame': True, 'axes_labels': ['$k$', f'$B(k,{n},{float(p)})$']}
BarChart = bar_chart([binom_dist.pmf(x) for x in range(n)], **Layout)
ListPlot = list_plot(data, plotjoined=True)
show(BarChart + ListPlot)