()
| 216 | |
| 217 | |
| 218 | def test_sine_plus_noise(): |
| 219 | np.random.seed(0) |
| 220 | x = (np.sin(np.linspace(0, np.pi * 2.0, 50000)) + |
| 221 | np.random.uniform(size=50000) * 0.01) |
| 222 | |
| 223 | fig, ax = plt.subplots() |
| 224 | p1 = ax.plot(x, solid_joinstyle='round', linewidth=2.0) |
| 225 | |
| 226 | # Ensure that the path's transform takes the new axes limits into account. |
| 227 | fig.canvas.draw() |
| 228 | path = p1[0].get_path() |
| 229 | transform = p1[0].get_transform() |
| 230 | path = transform.transform_path(path) |
| 231 | simplified = path.cleaned(simplify=True) |
| 232 | |
| 233 | assert simplified.vertices.size == 25240 |
| 234 | |
| 235 | |
| 236 | @image_comparison(['simplify_curve'], remove_text=True, style='_classic_test', |
nothing calls this directly
no test coverage detected
searching dependent graphs…