(fig_ref)
| 48 | |
| 49 | |
| 50 | def _generate_complete_test_figure(fig_ref): |
| 51 | fig_ref.set_size_inches((10, 6)) |
| 52 | plt.figure(fig_ref) |
| 53 | |
| 54 | plt.suptitle('Can you fit any more in a figure?') |
| 55 | |
| 56 | # make some arbitrary data |
| 57 | x, y = np.arange(8), np.arange(10) |
| 58 | data = u = v = np.linspace(0, 10, 80).reshape(10, 8) |
| 59 | v = np.sin(v * -0.6) |
| 60 | |
| 61 | # Ensure lists also pickle correctly. |
| 62 | plt.subplot(3, 3, 1) |
| 63 | plt.plot(list(range(10))) |
| 64 | plt.ylabel("hello") |
| 65 | |
| 66 | plt.subplot(3, 3, 2) |
| 67 | plt.contourf(data, hatches=['//', 'ooo']) |
| 68 | plt.colorbar() |
| 69 | |
| 70 | plt.subplot(3, 3, 3) |
| 71 | plt.pcolormesh(data) |
| 72 | |
| 73 | plt.subplot(3, 3, 4) |
| 74 | plt.imshow(data) |
| 75 | plt.ylabel("hello\nworld!") |
| 76 | |
| 77 | plt.subplot(3, 3, 5) |
| 78 | plt.pcolor(data) |
| 79 | |
| 80 | ax = plt.subplot(3, 3, 6) |
| 81 | ax.set_xlim(0, 7) |
| 82 | ax.set_ylim(0, 9) |
| 83 | plt.streamplot(x, y, u, v) |
| 84 | |
| 85 | ax = plt.subplot(3, 3, 7) |
| 86 | ax.set_xlim(0, 7) |
| 87 | ax.set_ylim(0, 9) |
| 88 | plt.quiver(x, y, u, v) |
| 89 | |
| 90 | plt.subplot(3, 3, 8) |
| 91 | plt.scatter(x, x ** 2, label='$x^2$') |
| 92 | plt.legend(loc='upper left') |
| 93 | |
| 94 | plt.subplot(3, 3, 9) |
| 95 | plt.errorbar(x, x * -0.5, xerr=0.2, yerr=0.4, label='$-.5 x$') |
| 96 | plt.legend(draggable=True) |
| 97 | |
| 98 | # Ensure subfigure parenting works. |
| 99 | subfigs = fig_ref.subfigures(2) |
| 100 | subfigs[0].subplots(1, 2) |
| 101 | subfigs[1].subplots(1, 2) |
| 102 | |
| 103 | fig_ref.align_ylabels() # Test handling of _align_label_groups Groupers. |
| 104 | |
| 105 | |
| 106 | @mpl.style.context("default") |
no test coverage detected
searching dependent graphs…