Open andrzejnovak opened 3 years ago
Those are different things. The style doesn't control where to anchor the bounding box of the text labels in matplotlib.
@kratsg what am I missing
import mplhep as hep
import matplotlib.pyplot as plt
import numpy as np
hep.style.use("ATLAS")
np.random.seed(0)
h, bins = np.histogram(np.random.normal(10, 3, 400), bins=10)
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 5))
hep.histplot(h, bins, ax=ax1)
hep.atlas.set_xlabel("FOO", ax=ax1)
hep.atlas.set_ylabel("FOO", ax=ax1)
hep.histplot(h, bins, ax=ax2)
ax2.set_xlabel("BAR")
ax2.set_ylabel("BAR")
@kratsg bump, newer mpl has the rcConfigs to do this
"xaxis.labellocation": "right",
"yaxis.labellocation": "top",
should confirm then we can drop. one tricky thing is to make sure the horizontal alignment/vertical alignment is set correctly even if the label location is configurable. Each axis treats it differently which is why it was a bit annoying.
@kratsg @matthewfeickert Are these still needed? https://github.com/scikit-hep/mplhep/blob/master/src/mplhep/atlas.py#L52
The label position should be configurable in the style (seems we already have that) https://github.com/scikit-hep/mplhep/blob/master/src/mplhep/styles/atlas.py#L51