From 66b478390c20089de7f9644ba9965ce5d4f973ff Mon Sep 17 00:00:00 2001 From: Stefan Appelhoff Date: Wed, 14 Apr 2021 13:22:01 +0200 Subject: [PATCH] DOC: Clarify how to derive dodge parameter value for aligning pointplot in stripplot (#2548) * DOC: clarify how to derive value for dodge param * DOC: fix typo develpoment -> development --- .github/CONTRIBUTING.md | 2 +- examples/jitter_stripplot.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index fe04b8a81c..2645f9c10e 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -26,4 +26,4 @@ Because matplotlib handles the actual rendering, errors or incorrect outputs may New features ------------ -If you think there is a new feature that should be added to seaborn, you can open an issue to discuss it. But please be aware that current development efforts are mostly focused on standardizing the API and internals, and there may be relatively low enthusiasm for novel features that do not fit well into short- and medium-term develpoment plans. +If you think there is a new feature that should be added to seaborn, you can open an issue to discuss it. But please be aware that current development efforts are mostly focused on standardizing the API and internals, and there may be relatively low enthusiasm for novel features that do not fit well into short- and medium-term development plans. diff --git a/examples/jitter_stripplot.py b/examples/jitter_stripplot.py index 7e5175682f..e5abf78ce3 100644 --- a/examples/jitter_stripplot.py +++ b/examples/jitter_stripplot.py @@ -21,12 +21,15 @@ sns.stripplot(x="value", y="measurement", hue="species", data=iris, dodge=True, alpha=.25, zorder=1) -# Show the conditional means +# Show the conditional means, aligning each pointplot in the +# center of the strips by adjusting the width allotted to each +# category (.8 by default) by the number of hue levels sns.pointplot(x="value", y="measurement", hue="species", - data=iris, dodge=.532, join=False, palette="dark", + data=iris, dodge=.8 - .8 / 3, + join=False, palette="dark", markers="d", scale=.75, ci=None) -# Improve the legend +# Improve the legend handles, labels = ax.get_legend_handles_labels() ax.legend(handles[3:], labels[3:], title="species", handletextpad=0, columnspacing=1,