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

Add example for plotting a bihistogram #27182

Merged
merged 6 commits into from
Oct 24, 2023
Merged

Add example for plotting a bihistogram #27182

merged 6 commits into from
Oct 24, 2023

Conversation

i-jey
Copy link
Contributor

@i-jey i-jey commented Oct 24, 2023

PR summary

Adds an example to the documentation for plotting a bihistogram (see the closed PR #27180 for prior discussion)

PR checklist

@scottshambaugh
Copy link
Contributor

scottshambaugh commented Oct 24, 2023

image

I think this example is well done and useful! Only suggestion is that I think it would make more sense visually when comparing datasets like this to have a constant bin width rather than constant number of bins, and share them between the datasets. For example:

bin_width = 0.25
bins = np.arange(np.min([dataset1, dataset2]), np.max([dataset1, dataset2]) + bin_width, bin_width)
ax.hist(dataset1, bins=bins, label="Dataset 1")

image

@i-jey
Copy link
Contributor Author

i-jey commented Oct 24, 2023

That's a good catch, totally agree. I've added that in, thanks for taking a look!

@i-jey i-jey marked this pull request as ready for review October 24, 2023 18:26
@scottshambaugh
Copy link
Contributor

scottshambaugh commented Oct 24, 2023

The built docs look good to me.

@scottshambaugh scottshambaugh merged commit 629baa8 into matplotlib:main Oct 24, 2023
19 checks passed
@scottshambaugh
Copy link
Contributor

scottshambaugh commented Oct 24, 2023

@i-jey thanks and congratulations on your first contribution to Matplotlib! 🎉

We hope to see you again!

@scottshambaugh scottshambaugh added this to the v3.9.0 milestone Oct 24, 2023
@scottshambaugh scottshambaugh added Documentation: examples files in galleries/examples Documentation and removed Documentation: examples files in galleries/examples labels Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation: examples files in galleries/examples Documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants