()
| 327 | |
| 328 | |
| 329 | def test_set_position(): |
| 330 | fig, ax = plt.subplots() |
| 331 | |
| 332 | # test set_position |
| 333 | ann = ax.annotate( |
| 334 | 'test', (0, 0), xytext=(0, 0), textcoords='figure pixels') |
| 335 | fig.canvas.draw() |
| 336 | |
| 337 | init_pos = ann.get_window_extent(fig.canvas.renderer) |
| 338 | shift_val = 15 |
| 339 | ann.set_position((shift_val, shift_val)) |
| 340 | fig.canvas.draw() |
| 341 | post_pos = ann.get_window_extent(fig.canvas.renderer) |
| 342 | |
| 343 | for a, b in zip(init_pos.min, post_pos.min): |
| 344 | assert a + shift_val == b |
| 345 | |
| 346 | # test xyann |
| 347 | ann = ax.annotate( |
| 348 | 'test', (0, 0), xytext=(0, 0), textcoords='figure pixels') |
| 349 | fig.canvas.draw() |
| 350 | |
| 351 | init_pos = ann.get_window_extent(fig.canvas.renderer) |
| 352 | shift_val = 15 |
| 353 | ann.xyann = (shift_val, shift_val) |
| 354 | fig.canvas.draw() |
| 355 | post_pos = ann.get_window_extent(fig.canvas.renderer) |
| 356 | |
| 357 | for a, b in zip(init_pos.min, post_pos.min): |
| 358 | assert a + shift_val == b |
| 359 | |
| 360 | |
| 361 | def test_char_index_at(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…