Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 30eb16a

Browse files
committed
more general solution - make sure 'colors' is a list rather than an array
1 parent a2d46ff commit 30eb16a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,11 +1180,8 @@ 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-
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])
1183+
colors = list(colors)
1184+
colors = colors * len(positions)
11881185
if len(linestyles) == 1:
11891186
linestyles = [linestyles] * len(positions)
11901187

0 commit comments

Comments
 (0)