Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit78e2134

Browse files
afvincenttacaswell
authored andcommitted
Naive fix for issue 8193
1 parentf5f3d79 commit78e2134

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎lib/matplotlib/axes/_axes.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,15 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
11811181
lineoffsets= [None]
11821182
iflen(colors)==0:
11831183
colors= [None]
1184+
try:
1185+
# Early conversion of the colors into RGBA values to take care
1186+
# of cases like colors='0.5' or colors='C1'. (Issue #8193)
1187+
colors=mcolors.to_rgba_array(colors)
1188+
exceptValueError:
1189+
# Will fail if any element of *colors* is None. But as long
1190+
# as len(colors) == 1 or len(positions), the rest of the
1191+
# code should process *colors* properly.
1192+
pass
11841193

11851194
iflen(lineoffsets)==1andlen(positions)!=1:
11861195
lineoffsets=np.tile(lineoffsets,len(positions))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp