Skip to content

Add example for plotting a bihistogram#27182

Merged
scottshambaugh merged 6 commits intomatplotlib:mainfrom
i-jey:bihistogram_example
Oct 24, 2023
Merged

Add example for plotting a bihistogram#27182
scottshambaugh merged 6 commits intomatplotlib:mainfrom
i-jey:bihistogram_example

Conversation

@i-jey
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

scottshambaugh commented Oct 24, 2023

The built docs look good to me.

@scottshambaugh scottshambaugh merged commit 629baa8 into matplotlib:main Oct 24, 2023
@scottshambaugh
Copy link
Copy Markdown
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.

2 participants