Skip to content

Commit 6934a7c

Browse files
authored
bugfix for plot for string x values
1 parent 2aa4aa9 commit 6934a7c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pandas/plotting/_core.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,8 @@ def _get_xticks(self, convert_period=False):
573573
self.data = self.data[notna(self.data.index)]
574574
self.data = self.data.sort_index()
575575
x = self.data.index._mpl_repr()
576+
elif all(isinstance(val, str) for val in index):
577+
x = index._mpl_repr()
576578
else:
577579
self._need_to_set_index = True
578580
x = lrange(len(index))

0 commit comments

Comments
 (0)