back to the matplotlib-gallery
at https://github.com/rasbt/matplotlib-gallery
In [1]:
%load_ext watermark
In [2]:
%watermark -u -v -d -p matplotlib,numpy
[More info](http://nbviewer.ipython.org/github/rasbt/python_reference/blob/master/ipython_magic/watermark.ipynb) about the `%watermark` extension
In [3]:
%matplotlib inline
In [3]:
import matplotlib.pyplot as plt
x1 = [-0.46,-1.25,-2.62,0.22]
x2 = [0.24,1.88,-0.49,-0.73,-0.49]
x3 = [-0.44,0.93,0.19,-4.36,-0.88]
fig = plt.figure(figsize=(8,6))
plt.boxplot([x for x in [x1, x2, x3]], 0, 'rs', 1)
plt.xticks([y+1 for y in range(len([x1, x2, x3]))], ['x1', 'x2', 'x3'])
plt.xlabel('measurement x')
t = plt.title('Box plot')
plt.show()
In [12]:
import matplotlib.pyplot as plt
x1 = [-0.46,-1.25,-2.62,0.22]
x2 = [0.24,1.88,-0.49,-0.73,-0.49]
x3 = [-0.44,0.93,0.19,-4.36,-0.88]
fig = plt.figure(figsize=(8,6))
bplot = plt.boxplot([x for x in [x1, x2, x3]], 0, 'rs', 1)
plt.xticks([y+1 for y in range(len([x1, x2, x3]))], ['x1', 'x2', 'x3'])
plt.xlabel('measurement x')
for components in bplot.keys():
for line in bplot[components]:
line.set_color('black')
t = plt.title('Black and white box plot')
plt.show()
In [ ]: