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

Skip to content

Commit 8291567

Browse files
ivanovphobson
authored andcommitted
fix typos, add axes titles
1 parent 49085a9 commit 8291567

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

examples/statistics/boxplot_color_demo.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""Box plots with custom fill colors.
22
3-
This plot illustrates how to create two types of boxplots
3+
This plot illustrates how to create two types of box plots
44
(rectangular and notched), and how to fill them with custom
55
colors by accessing the properties of the artists of the
6-
boxplots. Additionally, the ``labels`` parameter is used to
6+
box plots. Additionally, the ``labels`` parameter is used to
77
provide x-tick labels for each sample.
88
"""
99

@@ -19,16 +19,18 @@
1919

2020
# rectangular box plot
2121
bplot1 = axes[0].boxplot(all_data,
22-
vert=True, # vertical box aligmnent
22+
vert=True, # vertical box alignment
2323
patch_artist=True, # fill with color
2424
labels=labels) # will be used to label x-ticks
25+
axes[0].set_title('Rectangular box plot')
2526

2627
# notch shape box plot
2728
bplot2 = axes[1].boxplot(all_data,
2829
notch=True, # notch shape
29-
vert=True, # vertical box aligmnent
30+
vert=True, # vertical box alignment
3031
patch_artist=True, # fill with color
3132
labels=labels) # will be used to label x-ticks
33+
axes[1].set_title('Notched box plot')
3234

3335
# fill with colors
3436
colors = ['pink', 'lightblue', 'lightgreen']
@@ -39,7 +41,7 @@
3941
# adding horizontal grid lines
4042
for ax in axes:
4143
ax.yaxis.grid(True)
42-
ax.set_xlabel('Three Separate Samples')
44+
ax.set_xlabel('Three separate samples')
4345
ax.set_ylabel('Observed values')
4446

4547
plt.show()

examples/statistics/boxplot_vs_violin_demo.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
data (density trace).
66
77
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
8+
as outliers above or below the whiskers whereas violin plots show the whole
99
range of the data.
1010
1111
Violin plots require matplotlib >= 1.4.
@@ -22,18 +22,18 @@
2222
axes[0].violinplot(all_data,
2323
showmeans=False,
2424
showmedians=True)
25-
axes[0].set_title('violin plot')
25+
axes[0].set_title('Violin plot')
2626

2727
# plot box plot
2828
axes[1].boxplot(all_data)
29-
axes[1].set_title('box plot')
29+
axes[1].set_title('Box plot')
3030

3131
# adding horizontal grid lines
3232
for ax in axes:
3333
ax.yaxis.grid(True)
3434
ax.set_xticks([y + 1 for y in range(len(all_data))])
35-
ax.set_xlabel('xlabel')
36-
ax.set_ylabel('ylabel')
35+
ax.set_xlabel('Four separate samples')
36+
ax.set_ylabel('Observed values')
3737

3838
# add x-tick labels
3939
plt.setp(axes, xticks=[y + 1 for y in range(len(all_data))],

0 commit comments

Comments
 (0)