Skip to content
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

Improve hexbin() documentation #20397

Merged
merged 1 commit into from Jun 13, 2021
Merged

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented Jun 9, 2021

  • See-also-link between hexbin() and hist2d()
  • More compact example code notation
  • Better example Introduction

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.

Looks good, but a couple of small comments!

examples/statistics/hexbin_demo.py Outdated Show resolved Hide resolved
Hexagonal bins have less sampling bias from edge effects than rectangular
bins and can thus be a more correct representation of the data.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Hexagonal bins have less sampling bias from edge effects than rectangular
bins and can thus be a more correct representation of the data.
For some data distributions, hexagonal bins may have less sampling bias from edge effects than rectangular bins.

... though I'd just not say this at all, unless you have a citation to say that hexagonal bins are "more correct"

Copy link
Member Author

Choose a reason for hiding this comment

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

Hexagons are the maximum number of sides a polygon can havefor a regular tesselation of the plane, so in terms of packing a hexagon is 13%more efficient for covering the plane than squares. This property translates intobetter sampling efficiency at least for elliptical shapes. Lastly hexagons are vi-sually less biased for displaying densities than other regular tesselations. Forinstance with squares our eyes are drawn to the horizontal and vertical lines ofthe grid.

https://cran.r-project.org/web/packages/hexbin/vignettes/hexagon_binning.pdf

Copy link
Member

Choose a reason for hiding this comment

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

I agree for the example shown there, where the size of the bin is proportional to the density in the bin. Less convinced that it is true for a normal hex bin plot.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed.

@timhoffm timhoffm force-pushed the doc-hexbin branch 2 times, most recently from ba4a3ec to 9361a71 Compare June 9, 2021 23:43
- See-also-link between hexbin() and hist2d()
- More compact example code notation
- Better example Introduction

Co-authored-by: Jody Klymak <jklymak@gmail.com>
@jklymak jklymak merged commit f9bb47e into matplotlib:master Jun 13, 2021
@timhoffm timhoffm deleted the doc-hexbin branch June 14, 2021 06:22
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.

None yet

2 participants