0

Basically I want to add e.g. 20%-step-markers in my CDF plot, which i visualized in powerpoint like this:

enter image description here

I started out adding vertical lines (e.g. plot.axhline(y=0.2...)to then get the intersection but then I got stuck. Since a lot of books and papers actually have a visualization like the one I am showing, I wondered if there is a package that would do this in one line?

My code:

data = test_input #this is just a list with data
count, bins_count = np.histogram(data, bins=40)
pdf = count / sum(count)
cdf = np.cumsum(pdf)
plt.plot(bins_count[1:], cdf, label="CDF")
plt.legend()
plt.show()
Stefan 44
  • 157
  • 1
  • 9
  • Could you add the code that created the CDF plot? – JohanC Apr 02 '22 at 16:13
  • See also Pluviophile's answer at [How to plot empirical cdf (ecdf)](https://stackoverflow.com/a/70016616/12046409) – JohanC Apr 02 '22 at 16:20
  • @JohanC the link you posted was actually precisely what I am looking for. The function is also easy to edit. Good stuff. My code for the CDF was just a simply plt.plot For clarity I still edit this post with my code – Stefan 44 Apr 03 '22 at 08:49

0 Answers0