| 506 | |
| 507 | |
| 508 | def test_text_stale(): |
| 509 | fig, (ax1, ax2) = plt.subplots(1, 2) |
| 510 | plt.draw_all() |
| 511 | assert not ax1.stale |
| 512 | assert not ax2.stale |
| 513 | assert not fig.stale |
| 514 | |
| 515 | txt1 = ax1.text(.5, .5, 'aardvark') |
| 516 | assert ax1.stale |
| 517 | assert txt1.stale |
| 518 | assert fig.stale |
| 519 | |
| 520 | ann1 = ax2.annotate('aardvark', xy=[.5, .5]) |
| 521 | assert ax2.stale |
| 522 | assert ann1.stale |
| 523 | assert fig.stale |
| 524 | |
| 525 | plt.draw_all() |
| 526 | assert not ax1.stale |
| 527 | assert not ax2.stale |
| 528 | assert not fig.stale |
| 529 | |
| 530 | |
| 531 | @image_comparison(['agg_text_clip.png'], style='mpl20') |