Skip to content

Commit 9f4bbdd

Browse files
committed
Removed unused variable and comments
1 parent 62c1716 commit 9f4bbdd

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

examples/statistics/customized_violin_demo.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def adjacent_values(vals, q1, q3):
2424

2525
lower_adjacent_value = q1 - (q3 - q1) * 1.5
2626
lower_adjacent_value = np.clip(lower_adjacent_value, vals[0], q1)
27-
return [lower_adjacent_value, upper_adjacent_value]
27+
return lower_adjacent_value, upper_adjacent_value
2828

2929

3030
def set_axis_style(ax, labels):
@@ -60,13 +60,11 @@ def set_axis_style(ax, labels):
6060
pc.set_alpha(1)
6161

6262
quartile1, medians, quartile3 = np.percentile(data, [25, 50, 75], axis=1)
63-
inter_quartile_ranges = np.vstack([quartile1, quartile3]).T
64-
whiskers = [
63+
whiskers = np.array([
6564
adjacent_values(sorted_array, q1, q3)
66-
for sorted_array, q1, q3 in zip(data, quartile1, quartile3)]
67-
whiskersMin, whiskersMax = list(zip(*whiskers))
68-
# plot medians as points,
69-
# whiskers as thin lines, quartiles as fat lines
65+
for sorted_array, q1, q3 in zip(data, quartile1, quartile3)])
66+
whiskersMin, whiskersMax = whiskers[:, 0], whiskers[:, 1]
67+
7068
inds = np.arange(1, len(medians) + 1)
7169
ax2.scatter(inds, medians, marker='o', color='white', s=30, zorder=3)
7270
ax2.vlines(inds, quartile1, quartile3, color='k', linestyle='-', lw=5)

0 commit comments

Comments
 (0)