Skip to content

Commit 3caf8e6

Browse files
committed
Handle line and box on the same plot
1 parent dc8401a commit 3caf8e6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pandas/plotting/_matplotlib/core.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1855,7 +1855,6 @@ def __init__(
18551855
self.bar_width = width
18561856
self._align = align
18571857
self._position = position
1858-
self.tick_pos = np.arange(len(data))
18591858

18601859
if is_list_like(bottom):
18611860
bottom = np.array(bottom)
@@ -1868,6 +1867,12 @@ def __init__(
18681867

18691868
MPLPlot.__init__(self, data, **kwargs)
18701869

1870+
self.tick_pos = (
1871+
np.array(self.ax.xaxis.convert_units(self._get_xticks()))
1872+
if isinstance(data.index, ABCPeriodIndex)
1873+
else np.arange(len(data))
1874+
)
1875+
18711876
@cache_readonly
18721877
def ax_pos(self) -> np.ndarray:
18731878
return self.tick_pos - self.tickoffset

0 commit comments

Comments
 (0)