Skip to content

Commit 7b20246

Browse files
committed
bugfix for plot for string x values
1 parent cd484cc commit 7b20246

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pandas/plotting/_core.py

+2
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)