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 metadata attributes to ashist() for improved plotting #635

Merged
merged 10 commits into from
Dec 10, 2024

Conversation

willcollins10
Copy link
Contributor

Description

This PR adds metadata attributes (xlabel, ylabel, and title) to the ashist() function's output DataFrame. These attributes simplify the plotting process by providing standardized labels, reducing the need for manual labeling, and ensuring consistency across different plots.

Changes Made

  • Added df.attrs["xlabel"] = "Value"
  • Added df.attrs["ylabel"] = "Probability" if density else "Count"
  • Added df.attrs["title"] = "Histogram"

Testing

  • Added unit tests to verify the presence and correctness of the metadata attributes.
  • Ensured that existing functionality remains unaffected.

Related Issues

Closes #<606>

@willcollins10 willcollins10 marked this pull request as ready for review December 8, 2024 20:18
@nwlandry
Copy link
Collaborator

Looks good! Thanks so much, @willcollins10!

@nwlandry nwlandry merged commit e4b3c3b into xgi-org:main Dec 10, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants