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 conversion routines for boost_histogram and hist #462

Merged
merged 4 commits into from
Mar 1, 2021
Merged

Conversation

nsmith-
Copy link
Member

@nsmith- nsmith- commented Feb 25, 2021

Still needs some tests

)
newaxis.name = axis.name
newaxis.label = axis.label
newaxis.bin_labels = [x.label for x in identifiers]
Copy link
Member Author

Choose a reason for hiding this comment

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

@andrzejnovak do you know if category custom labels (e.g. latex) are supported in hist/mplhep?

Copy link
Collaborator

Choose a reason for hiding this comment

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

mpl will render that fine, but I don't think hist HTML repr can interpret latex (@henrii)

Copy link
Collaborator

Choose a reason for hiding this comment

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

image

Copy link
Member Author

Choose a reason for hiding this comment

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

I noticed that issue as well, but here I'm asking about StrCategory axes. In coffea hists, when displaying a histogram with a StrCategory axis, by default it would use the category names as bin labels, but one could optionally override the category names with custom labels (so that the filling code could still use a simple ascii shorthand like jetptcut while the plot would show a more expressive label like $p_{T,j} \geq 100 GeV$)

@nsmith- nsmith- marked this pull request as ready for review March 1, 2021 04:31
@nsmith-
Copy link
Member Author

nsmith- commented Mar 1, 2021

I'm going to merge as-is, perhaps later we'll find a convention for overriding bin labels.

@nsmith- nsmith- merged commit 327f6a9 into master Mar 1, 2021
@nsmith- nsmith- deleted the boosthist branch March 1, 2021 20:56
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.

None yet

2 participants