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

Skip to content

Commit 06b5ed5

Browse files
committed
Converted from dict to ternary
1 parent c917b09 commit 06b5ed5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/tests/test_text.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ def test_contains():
140140

141141
contains, _ = txt.contains(mevent)
142142

143-
color = {False: 'red', True: 'yellow'}.get(contains)
143+
color = 'yellow' if contains else 'red'
144144

145145
# capture the viewLim, plot a point, and reset the viewLim
146146
vl = ax.viewLim.frozen()
147147
ax.plot(x, y, 'o', color=color)
148148
ax.viewLim.set(vl)
149-
149+

0 commit comments

Comments
 (0)