Skip to content

Updated violin plot example as per suggestions in issue #7251 #7360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 31, 2016
Prev Previous commit
Next Next commit
Changed variable 'tmp' to 'quartiles' and slightly altered transpose …
…calculation
  • Loading branch information
DrNightmare committed Oct 30, 2016
commit 8044e9d4e328f4ac5894ef0c48e6d47e937cd60f
6 changes: 3 additions & 3 deletions examples/statistics/customized_violin_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def set_axis_style(ax, labels):
pc.set_edgecolor('black')
pc.set_alpha(1)

tmp = (np.percentile(data, [25, 50, 75], axis=1)).T
medians = tmp[:, 1]
inter_quartile_ranges = tmp[:, [0, 2]]
quartiles = (np.percentile(data, [25, 50, 75], axis=1))
medians = quartiles[1]
inter_quartile_ranges = quartiles[[0, 2]].T
whiskers = [adjacent_values(sorted_array) for sorted_array in data]

# plot whiskers as thin lines, quartiles as fat lines,
Expand Down