Skip to content

Instantly share code, notes, and snippets.

@vb100
Created June 12, 2018 10:48
Show Gist options
  • Save vb100/2562783bce02256b3ed7e693053da6ef to your computer and use it in GitHub Desktop.
Save vb100/2562783bce02256b3ed7e693053da6ef to your computer and use it in GitHub Desktop.
Comparing percentiles to ECDF To see how the percentiles relate to the ECDF, you will plot the percentiles of Iris versicolor petal lengths you calculated in the last exercise on the ECDF plot you generated in chapter 1. The percentile variables from the previous exercise are available in the workspace as ptiles_vers and percentiles. Note that t…
# Plot the ECDF
_ = plt.plot(x_vers, y_vers, '.')
plt.margins(0.02)
_ = plt.xlabel('petal length (cm)')
_ = plt.ylabel('ECDF')
# Overlay percentiles as red diamonds.
_ = plt.plot(ptiles_vers, percentiles/100, marker='D', color='red',
linestyle='none')
# Show the plot
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment