MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_annotate_across_transforms

Function test_annotate_across_transforms

lib/matplotlib/tests/test_axes.py:8515–8527  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8513@image_comparison(['annotate_across_transforms.png'], style='mpl20', remove_text=True,
8514 tol=0 if platform.machine() == 'x86_64' else 0.025)
8515def test_annotate_across_transforms():
8516 x = np.linspace(0, 10, 200)
8517 y = np.exp(-x) * np.sin(x)
8518
8519 fig, ax = plt.subplots(figsize=(3.39, 3))
8520 ax.plot(x, y)
8521 axins = ax.inset_axes([0.4, 0.5, 0.3, 0.3])
8522 axins.set_aspect(0.2)
8523 axins.xaxis.set_visible(False)
8524 axins.yaxis.set_visible(False)
8525 ax.annotate("", xy=(x[150], y[150]), xycoords=ax.transData,
8526 xytext=(1, 0), textcoords=axins.transAxes,
8527 arrowprops=dict(arrowstyle="->"))
8528
8529
8530class _Translation(mtransforms.Transform):

Callers

nothing calls this directly

Calls 6

inset_axesMethod · 0.80
annotateMethod · 0.80
subplotsMethod · 0.45
plotMethod · 0.45
set_aspectMethod · 0.45
set_visibleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…