You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the root2matplotlib module to plot root histograms. I would like to have the ticks on the inner side of the axis, but they are covered by the histogram. Specifying a large value for zorder does not solve the problem. Note that the green line has a smaller zorder value than the ticks, yet it is shown on top of the histogram.
from __future__ import division, print_function
import matplotlib
import matplotlib.pyplot as plt
import rootpy.io
import rootpy.plotting
import rootpy.plotting.root2matplotlib
f = rootpy.io.root_open('samplehistogram.root')
h = f['h']
fig, ax = plt.subplots(1, 1)
rootpy.plotting.root2matplotlib.hist(h, color='red', axes=ax)
ax.tick_params(which='both', direction='in', zorder=10)
ax.axvline(0, color='green', linestyle='--', zorder=5)
plt.tight_layout()
fig.show()
I found the unrelated #537, but the picture therein shows the ticks on the inside in front of the histograms. When I run the code now, the ticks are on the outside. If I manually place them on the inside, the histograms overlays them.
Tested with
Python 2.7.16, matplotlib 2.2.4, rootpy 1.0.1
The text was updated successfully, but these errors were encountered:
I found a workaround: If one explicitly specifies the zorder of the histograms, the axis ticks aren't covered -- even if one does not specify the zorder of the ticks.
Hi all,
I am using the root2matplotlib module to plot root histograms. I would like to have the ticks on the inner side of the axis, but they are covered by the histogram. Specifying a large value for
zorder
does not solve the problem. Note that the green line has a smallerzorder
value than the ticks, yet it is shown on top of the histogram.samplehistogram.root.gz
As a sanity check, this works as intended in matplotlib:
I found the unrelated #537, but the picture therein shows the ticks on the inside in front of the histograms. When I run the code now, the ticks are on the outside. If I manually place them on the inside, the histograms overlays them.
Tested with
The text was updated successfully, but these errors were encountered: