()
| 365 | |
| 366 | @mpl3d_image_comparison(['mixedsubplot.png'], style='mpl20') |
| 367 | def test_mixedsubplots(): |
| 368 | def f(t): |
| 369 | return np.cos(2*np.pi*t) * np.exp(-t) |
| 370 | |
| 371 | t1 = np.arange(0.0, 5.0, 0.1) |
| 372 | t2 = np.arange(0.0, 5.0, 0.02) |
| 373 | |
| 374 | plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated |
| 375 | fig = plt.figure(figsize=plt.figaspect(2.)) |
| 376 | ax = fig.add_subplot(2, 1, 1) |
| 377 | ax.plot(t1, f(t1), 'bo', t2, f(t2), 'k--', markerfacecolor='green') |
| 378 | ax.grid(True) |
| 379 | |
| 380 | ax = fig.add_subplot(2, 1, 2, projection='3d') |
| 381 | X, Y = np.meshgrid(np.arange(-5, 5, 0.25), np.arange(-5, 5, 0.25)) |
| 382 | R = np.hypot(X, Y) |
| 383 | Z = np.sin(R) |
| 384 | |
| 385 | ax.plot_surface(X, Y, Z, rcount=40, ccount=40, |
| 386 | linewidth=0, antialiased=False) |
| 387 | |
| 388 | ax.set_zlim3d(-1, 1) |
| 389 | |
| 390 | |
| 391 | @check_figures_equal() |
nothing calls this directly
no test coverage detected
searching dependent graphs…