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

Function test_mixedsubplots

lib/mpl_toolkits/mplot3d/tests/test_axes3d.py:367–388  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

365
366@mpl3d_image_comparison(['mixedsubplot.png'], style='mpl20')
367def 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()

Callers

nothing calls this directly

Calls 6

figureMethod · 0.80
add_subplotMethod · 0.80
plot_surfaceMethod · 0.80
fFunction · 0.70
plotMethod · 0.45
gridMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…