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

Function test_contour_manual_moveto

lib/matplotlib/tests/test_contour.py:112–128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110
111
112def test_contour_manual_moveto():
113 x = np.linspace(-10, 10)
114 y = np.linspace(-10, 10)
115
116 X, Y = np.meshgrid(x, y)
117
118 Z = X**2 * 1 / Y**2 - 1
119
120 contours = plt.contour(X, Y, Z, levels=[0, 100])
121
122 # This point lies on the `MOVETO` line for the 100 contour
123 # but is actually closest to the 0 contour
124 point = (1.3, 1)
125 clabels = plt.clabel(contours, manual=[point])
126
127 # Ensure that the 0 contour was chosen, not the 100 contour
128 assert clabels[0].get_text() == "0"
129
130
131@image_comparison(['contour_disconnected_segments.png'],

Callers

nothing calls this directly

Calls 3

contourMethod · 0.45
clabelMethod · 0.45
get_textMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…