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?
labelis easy, it's not read-only. Only name is, because we validate that it doesn't get duplicated inside a histogram. You can set it via a secret method (
hist_1.axes._ax.metadata, IIRC), but I've intended to allow it to be set in bulk, that is,
hist.axes.name = ("name1", "name2"), as that we can validate. I'll open an issue for that.
np.sqrt(h.values()))automatically? For generating ratio plots I understand I can use the
hist.intervalsmodule, is this the current "best practice"?
I paste the small part :
fig1, axs1= plt.subplots(1,2,figsize=(20, 10))
s1 = histograms.stack("cat")