Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a3f2362

Browse files
anedaphobson
authored andcommitted
Cleanup : doc string and pep8
1 parent ed4d7e7 commit a3f2362

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

examples/statistics/boxplot_vs_violin_demo.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
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.
102
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+
"""
1113
import matplotlib.pyplot as plt
1214
import numpy as np
1315

@@ -29,11 +31,11 @@
2931
# adding horizontal grid lines
3032
for ax in axes:
3133
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))])
3335
ax.set_xlabel('xlabel')
3436
ax.set_ylabel('ylabel')
3537

3638
# 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))],
3840
xticklabels=['x1', 'x2', 'x3', 'x4'])
3941
plt.show()

0 commit comments

Comments
 (0)