We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bfb1dd1 commit e4d5040Copy full SHA for e4d5040
pandas/plotting/_matplotlib/core.py
@@ -1939,14 +1939,11 @@ def _make_plot(self, fig: Figure) -> None:
1939
subplots_flag = 0
1940
1941
if subplots_flag & self.stacked:
1942
- sub_range = range(len(self.subplots))
1943
- ss_temp = {
1944
- x: self.subplots[x] for x in sub_range if len(self.subplots[x]) > 1
1945
- }
1946
- for k, v in ss_temp.items():
1947
- for x in v:
1948
- _stacked_subplots_ind.setdefault(int(x), k)
1949
-
+ for i, sub_plot in enumerate(self.subplots):
+ if len(sub_plot) <= 1:
+ continue
+ for plot in sub_plot:
+ _stacked_subplots_ind[int(plot)] = i
1950
_stacked_subplots_offsets.append([0, 0])
1951
1952
for i, (label, y) in enumerate(self._iter_data(data=data)):
0 commit comments