|
23 | 23 | [0.6, 0.3, 0.0, 0.2], [0.7, 0.9, 0.4, 0.6]]) |
24 | 24 |
|
25 | 25 | # Create a 2x2 table of plots |
26 | | -fig = plt.figure(figsize=[8.0, 7.5]) |
27 | | -ax = plt.subplot(2, 2, 1) |
28 | | -ax.imshow(big_im, interpolation='none') |
29 | | -ax = plt.subplot(2, 2, 2) |
30 | | -ax.imshow(big_im, interpolation='nearest') |
31 | | -ax = plt.subplot(2, 2, 3) |
32 | | -ax.imshow(small_im, interpolation='none') |
33 | | -ax = plt.subplot(2, 2, 4) |
34 | | -ax.imshow(small_im, interpolation='nearest') |
35 | | -plt.subplots_adjust(left=0.24, wspace=0.2, hspace=0.1, |
| 26 | +fig, axes = plt.subplots(figsize=[8.0, 7.5], ncols=2, nrows=2) |
| 27 | + |
| 28 | +axes[0, 0].imshow(big_im, interpolation='none') |
| 29 | +axes[0, 1].imshow(big_im, interpolation='nearest') |
| 30 | +axes[1, 0].imshow(small_im, interpolation='none') |
| 31 | +axes[1, 1].imshow(small_im, interpolation='nearest') |
| 32 | +fig.subplots_adjust(left=0.24, wspace=0.2, hspace=0.1, |
36 | 33 | bottom=0.05, top=0.86) |
37 | 34 |
|
38 | 35 | # Label the rows and columns of the table |
|
60 | 57 | pdf_im_path = cbook.get_sample_data('None_vs_nearest-pdf.png') |
61 | 58 | pdf_im = plt.imread(pdf_im_path) |
62 | 59 | fig2 = plt.figure(figsize=[8.0, 7.5]) |
63 | | -plt.figimage(pdf_im) |
| 60 | +fig2.figimage(pdf_im) |
64 | 61 |
|
65 | 62 | plt.show() |
0 commit comments