forked from rougier/matplotlib-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboxplot.py
More file actions
36 lines (30 loc) · 938 Bytes
/
boxplot.py
File metadata and controls
36 lines (30 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(8,5),dpi=72)
fig.patch.set_alpha(0.0)
axes = plt.subplot(111)
n = 5
Z = np.zeros((n,4))
X = np.linspace(0,2,n,endpoint=True)
Y = np.random.random((n,4))
plt.boxplot(Y)
#plt.xlim(-0.2,4.2)
#plt.ylim(-1.2,1.2)
plt.xticks([]), plt.yticks([])
plt.text(-0.05, 1.05, " Box Plot \n\n",
horizontalalignment='left',
verticalalignment='top',
family='Lint McCree Intl BB',
size='x-large',
bbox=dict(facecolor='white', alpha=1.0, width=350,height=60),
transform = axes.transAxes)
plt.text(-0.05, .95, " Make a box and whisker plot ",
horizontalalignment='left',
verticalalignment='top',
family='Lint McCree Intl BB',
size='medium',
transform = axes.transAxes)
plt.savefig('../figures/boxplot.png', dpi=64)
plt.show()