()
| 453 | |
| 454 | |
| 455 | def test_draggable_in_subfigure(): |
| 456 | fig = plt.figure() |
| 457 | # Put annotation at lower left corner to make it easily pickable below. |
| 458 | ann = fig.subfigures().add_axes((0, 0, 1, 1)).annotate("foo", (0, 0)) |
| 459 | ann.draggable(True) |
| 460 | fig.canvas.draw() # Texts are non-pickable until the first draw. |
| 461 | MouseEvent("button_press_event", fig.canvas, 1, 1)._process() |
| 462 | assert ann._draggable.got_artist |
| 463 | # Stop dragging the annotation. |
| 464 | MouseEvent("button_release_event", fig.canvas, 1, 1)._process() |
| 465 | assert not ann._draggable.got_artist |
| 466 | # A scroll event should not initiate a drag. |
| 467 | MouseEvent("scroll_event", fig.canvas, 1, 1)._process() |
| 468 | assert not ann._draggable.got_artist |
| 469 | # An event outside the annotation should not initiate a drag. |
| 470 | bbox = ann.get_window_extent() |
| 471 | MouseEvent("button_press_event", fig.canvas, bbox.x1+2, bbox.y1+2)._process() |
| 472 | assert not ann._draggable.got_artist |
| 473 | |
| 474 | |
| 475 | def test_anchored_offsetbox_tuple_and_float_borderpad(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…