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

Skip to content

Commit 028dd77

Browse files
authored
Merge pull request #4 from eslothower/fix-check
Remove figure not None check
2 parents 0a062ed + f9ab7f4 commit 028dd77

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

lib/matplotlib/artist.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,6 @@ def set_hover(self, hover):
649649
artist will fire a hover event if the mouse event is hovering over
650650
the artist.
651651
"""
652-
if not self.figure and hover is not None:
653-
raise ValueError("Cannot hover without an existing figure")
654652
self._hover = hover
655653

656654
def get_hover(self):

lib/matplotlib/tests/test_artist.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,6 @@ def test_set_alpha_for_array():
326326

327327

328328
def test_set_hover():
329-
art = martist.Artist() # blank canvas
330-
with pytest.raises(ValueError, match="Cannot hover without an existing figure"):
331-
art.set_hover(True)
332-
333329
fig, ax = plt.subplots()
334330
im = ax.imshow(np.arange(36).reshape(6, 6)) # non-blank canvas
335331

0 commit comments

Comments
 (0)