| 21 | |
| 22 | |
| 23 | def test_simple(): |
| 24 | fig = plt.figure() |
| 25 | pickle.dump(fig, BytesIO(), pickle.HIGHEST_PROTOCOL) |
| 26 | |
| 27 | ax = plt.subplot(121) |
| 28 | pickle.dump(ax, BytesIO(), pickle.HIGHEST_PROTOCOL) |
| 29 | |
| 30 | ax = plt.axes(projection='polar') |
| 31 | plt.plot(np.arange(10), label='foobar') |
| 32 | plt.legend() |
| 33 | |
| 34 | pickle.dump(ax, BytesIO(), pickle.HIGHEST_PROTOCOL) |
| 35 | |
| 36 | # ax = plt.subplot(121, projection='hammer') |
| 37 | # pickle.dump(ax, BytesIO(), pickle.HIGHEST_PROTOCOL) |
| 38 | |
| 39 | plt.figure() |
| 40 | plt.bar(x=np.arange(10), height=np.arange(10)) |
| 41 | pickle.dump(plt.gca(), BytesIO(), pickle.HIGHEST_PROTOCOL) |
| 42 | |
| 43 | fig = plt.figure() |
| 44 | ax = plt.axes() |
| 45 | plt.plot(np.arange(10)) |
| 46 | ax.set_yscale('log') |
| 47 | pickle.dump(fig, BytesIO(), pickle.HIGHEST_PROTOCOL) |
| 48 | |
| 49 | |
| 50 | def _generate_complete_test_figure(fig_ref): |