File tree 1 file changed +13
-11
lines changed 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change 1
- # Box plot - violin plot comparison
2
- #
3
- # Note that although violin plots are closely related to Tukey's (1977) box plots,
4
- # they add useful information such as the distribution of the sample data (density trace).
5
- #
6
- # By default, box plots show data points outside 1.5 x the inter-quartile range as outliers
7
- # above or below the whiskers wheras violin plots show the whole range of the data.
8
- #
9
- # Violin plots require matplotlib >= 1.4.
1
+ """Box plot - violin plot comparison.
10
2
3
+ Note that although violin plots are closely related to Tukey's (1977) box
4
+ plots, they add useful information such as the distribution of the sample
5
+ data (density trace).
6
+
7
+ By default, box plots show data points outside 1.5 x the inter-quartile range
8
+ as outliers above or below the whiskers wheras violin plots show the whole
9
+ range of the data.
10
+
11
+ Violin plots require matplotlib >= 1.4.
12
+ """
11
13
import matplotlib .pyplot as plt
12
14
import numpy as np
13
15
29
31
# adding horizontal grid lines
30
32
for ax in axes :
31
33
ax .yaxis .grid (True )
32
- ax .set_xticks ([y + 1 for y in range (len (all_data ))])
34
+ ax .set_xticks ([y + 1 for y in range (len (all_data ))])
33
35
ax .set_xlabel ('xlabel' )
34
36
ax .set_ylabel ('ylabel' )
35
37
36
38
# add x-tick labels
37
- plt .setp (axes , xticks = [y + 1 for y in range (len (all_data ))],
39
+ plt .setp (axes , xticks = [y + 1 for y in range (len (all_data ))],
38
40
xticklabels = ['x1' , 'x2' , 'x3' , 'x4' ])
39
41
plt .show ()
You can’t perform that action at this time.
0 commit comments