Skip to content

Commit a2d46ff

Browse files
committed
handling of color=None by eventplot(), fixes #3728
1 parent 6dfeab5 commit a2d46ff

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,8 +1180,11 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
11801180
if len(linewidths) == 1:
11811181
linewidths = np.tile(linewidths, len(positions))
11821182
if len(colors) == 1:
1183-
colors = np.asanyarray(colors)
1184-
colors = np.tile(colors, [len(positions), 1])
1183+
if colors[0] is None:
1184+
colors = colors * len(positions)
1185+
else:
1186+
colors = np.asanyarray(colors)
1187+
colors = np.tile(colors, [len(positions), 1])
11851188
if len(linestyles) == 1:
11861189
linestyles = [linestyles] * len(positions)
11871190

0 commit comments

Comments
 (0)