()
| 260 | tol=1 if parse_version(np.version.version).major < 2 else |
| 261 | 0 if platform.machine() == 'x86_64' else 0.005) |
| 262 | def test_labels(): |
| 263 | # Adapted from pylab_examples example code: contour_demo.py |
| 264 | # see issues #2475, #2843, and #2818 for explanation |
| 265 | delta = 0.025 |
| 266 | x = np.arange(-3.0, 3.0, delta) |
| 267 | y = np.arange(-2.0, 2.0, delta) |
| 268 | X, Y = np.meshgrid(x, y) |
| 269 | Z1 = np.exp(-(X**2 + Y**2) / 2) / (2 * np.pi) |
| 270 | Z2 = (np.exp(-(((X - 1) / 1.5)**2 + ((Y - 1) / 0.5)**2) / 2) / |
| 271 | (2 * np.pi * 0.5 * 1.5)) |
| 272 | |
| 273 | # difference of Gaussians |
| 274 | Z = 10.0 * (Z2 - Z1) |
| 275 | |
| 276 | fig, ax = plt.subplots(1, 1) |
| 277 | CS = ax.contour(X, Y, Z) |
| 278 | disp_units = [(216, 177), (359, 290), (521, 406)] |
| 279 | data_units = [(-2, .5), (0, -1.5), (2.8, 1)] |
| 280 | |
| 281 | CS.clabel() |
| 282 | |
| 283 | for x, y in data_units: |
| 284 | CS.add_label_near(x, y, inline=True, transform=None) |
| 285 | |
| 286 | for x, y in disp_units: |
| 287 | CS.add_label_near(x, y, inline=True, transform=False) |
| 288 | |
| 289 | |
| 290 | def test_label_contour_start(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…