Created
March 9, 2013 17:18
-
-
Save jmcarp/5124886 to your computer and use it in GitHub Desktop.
Basic boxplot with dots.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import matplotlib | |
from matplotlib import pyplot as plt | |
# Define data | |
data_grp1 = [1, 2, 3, 4, 5, 3, 2, 1, 5, 6, 4, 2, 4] | |
data_grp2 = [6, 7, 8, 7, 8, 9, 1, 1, 9, 15] | |
# Boxplot | |
plt.boxplot([data_grp1, data_grp2]) | |
# Dots | |
plt.plot([1] * len(data_grp1), data_grp1, 'o') | |
plt.plot([2] * len(data_grp2), data_grp2, 'o') | |
# Show plot | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment