Skip to content

Move "howto interpreting box plots" to boxplot docstring #19860

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 1 commit into from
Apr 4, 2021

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented Apr 3, 2021

PR Summary

The explanation of a box plot is better placed at to the boxplot() function.

@timhoffm timhoffm added this to the v3.4.2 milestone Apr 3, 2021
Box plots provide insight into distribution properties of the data.
However, they can be challenging to interpret for the unfamiliar
reader. The figure below illustrates the different visual features of
a box plot.
Copy link
Contributor

@anntzer anntzer Apr 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider also linking to the website version so that people displaying the docstring at their terminal have somewhere to click

or alternatively just replace the png by some ascii art:

       Q1-1.5IQR   Q1   median  Q3   Q3+1.5IQR
                    |-----:-----|
    .      |--------|     :     |--------|   .  .
                    |-----:-----|
 outlier            <----------->
                         IQR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a link to wikipedia, which IMHO is sufficient.

Furthermore, this note only gives additional context. I assume that only a minority of people will try to learn from the docstring (It's rather used for looking up signature and specific parameters). I don't want to jump extra hoops here. You are welcome to do more yourself.

@anntzer
Copy link
Contributor

anntzer commented Apr 4, 2021

Let's merge this as improvement; I'll make the asciiart in a separate PR.

@anntzer anntzer merged commit fb0c10d into matplotlib:master Apr 4, 2021
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Apr 4, 2021
@timhoffm timhoffm deleted the doc-boxplot branch April 4, 2021 22:05
@timhoffm
Copy link
Member Author

timhoffm commented Apr 4, 2021

I'll make the asciiart in a separate PR.

@anntzer I'm -0.1 on this because the ascii-art is only a rough visual approximation of the box and harder to read than an actual image. It's a trade-off between having the info in the ascii docstring and readability in the html output. But I won't block a PR.

Note that if you do the ascii-art, you'll likely have to use some left-side character for aligning the ascii lines. ReST messes up if any line in the code block is less indented than the first line. See e.g. https://matplotlib.org/devdocs/api/_as_gen/matplotlib.axes.Axes.barbs.html

timhoffm added a commit that referenced this pull request Apr 5, 2021
…860-on-v3.4.x

Backport PR #19860 on branch v3.4.x (Move "howto interpreting box plots" to boxplot docstring)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants