Skip to content

[Example] update Anscombe's Quartet #18814

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 3 commits into from
Oct 26, 2020
Merged

[Example] update Anscombe's Quartet #18814

merged 3 commits into from
Oct 26, 2020

Conversation

baogianghoangvu
Copy link
Contributor

PR Summary

Hi!

This PR includes a tiny change to the Anscombe's Quartet example:

  • current version: the linear regression lines only go from min(x) to max(x) per plot.
  • updated version: the lines go the entire length of the plots, similar to the Wikipedia page

Reason for this update:

When I looked at the IV quadrant, I thought that its linear regression line was different from the rest in terms of its intercept, slope seemed the same, but even though I squinted hard, I still doubted my prior assumption that all 4 datasets should result in the same summary statistics (and therefore also regression slopes & intercepts). I visited Wikipedia and confirmed that indeed the 4 lines should be (almost) exactly the same.

Maybe it's just me but I couldn't easily see the similarity of the regression lines between the IV and the rest (and even the other 3 among themselves feel a bit iffy). I think making the regression lines go through the entire plots would drive home the idea of Anscombe's Quartet much more decisively.

Hope this helps and doesn't take too much of your time reviewing.

Thanks!

PR Checklist

(I took the liberty to remove the checklist items that are not so relevant for this tiny update to an example)

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).

Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

We have a new method axline that seems ready-made for this case...

@baogianghoangvu
Copy link
Contributor Author

Thank you @jklymak for your quick review! Hope this is better now.

@jklymak jklymak added this to the v3.4.0 milestone Oct 26, 2020
Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

We have been (somewhat piecemeal) adding a block at the bottom that lists the important methods used but our examples....

(i.e. look at the bottom of examples/color/color_cycle_default.py)

@baogianghoangvu
Copy link
Contributor Author

Oh I see. Added.

@jklymak jklymak merged commit 8d2e360 into matplotlib:master Oct 26, 2020
@jklymak
Copy link
Member

jklymak commented Oct 26, 2020

Thanks @baogianghoangvu Looks great!

@baogianghoangvu
Copy link
Contributor Author

Thank you for your guidance!

@baogianghoangvu baogianghoangvu deleted the anscombes-quartet branch October 26, 2020 19:06
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.

2 participants