coffeaif I understand that correctly) and then save all at once?
In this talk, https://indico.cern.ch/event/1028381/#6-pythonic-data-science, I pointed out that this is an area that needs improvement: serialization of boost-histograms and interoperability with ROOT. One avenue is to use ROOT histograms as the serialization format, which takes advantage of the predominance of that format, but would lose some of the boost-histogram features, like mixed categorical/continuous axes. Uproot writing should do those conversions in either case.
Beyond that, there ought to be a lossless way to save and load boost-histograms.
This is likely a very easy question, but I haven't found the answer. What's a quick way to
h.plot(...) with a logarithmic y-axis? I've tried
I could follow the example given in scikit-hep/hist#198 and extract the
ax object out of the output, but I'm writing a tutorial and I want to show how easy this is. (It's for the Uproot tutorial, but I'm trying to include related libraries.)
Hist.plotis sending some properties downstream (i.e. nothing to look up: they're defined by Matplotlib), in the StepPatch object it turns out.
axis definitely good. That's saved me a few times (in Pandas).
matplotlib.pyplot as pltis, duplicating the interface is not the way. For faster access I could see 2 options 1) have a shortcut to pyplot with
.plot()returning the ax object. I think Henry is very pro returning the artists, but the tuple with the artists could quite easily contain the ax as well. Then you could do
h_obj.plot().ax.semilogy()if you really wanted a one-liner
This isn't directly related, but this is reminding me of when I learned about how to use interactive vs. non-interactive
matploltlib backends earlier this year and how that relates between using the
h.view() / h2.view()
hist.hist.Histobject that someone else made and serialized to give to you, and upon deserializing realize that the
labelfield for the axes has information that should have been put in
metadataplaced in them (e.g.,
wjetsinstead of something like
pt) is there a way to update the
labelin a copy of the histogram?
labelare read only in boost-histogram, so is there any way to get around this other then manually making new histogram objects and filling them with the old histogram contents?