|
1 | | -""" |
| 1 | +`""" |
2 | 2 | Demonstrates similarities between pcolor, pcolormesh, imshow and pcolorfast |
3 | 3 | for drawing quadrilateral grids. |
4 | 4 |
|
|
20 | 20 |
|
21 | 21 |
|
22 | 22 | plt.subplot(2, 2, 1) |
23 | | -plt.pcolor(x, y, z, vmin=z_min, vmax=z_max) |
| 23 | +plt.pcolor(x, y, z, cmap='RdBu', vmin=z_min, vmax=z_max) |
24 | 24 | plt.title('pcolor') |
25 | 25 | # set the limits of the plot to the limits of the data |
26 | 26 | plt.axis([x.min(), x.max(), y.min(), y.max()]) |
27 | 27 | plt.colorbar() |
28 | 28 |
|
29 | 29 |
|
30 | 30 | plt.subplot(2, 2, 2) |
31 | | -plt.pcolormesh(x, y, z, vmin=z_min, vmax=z_max) |
| 31 | +plt.pcolormesh(x, y, z, cmap='RdBu', vmin=z_min, vmax=z_max) |
32 | 32 | plt.title('pcolormesh') |
33 | 33 | # set the limits of the plot to the limits of the data |
34 | 34 | plt.axis([x.min(), x.max(), y.min(), y.max()]) |
35 | 35 | plt.colorbar() |
36 | 36 |
|
37 | 37 |
|
38 | 38 | plt.subplot(2, 2, 3) |
39 | | -plt.imshow(z, vmin=z_min, vmax=z_max, |
| 39 | +plt.imshow(z, cmap='RdBu', vmin=z_min, vmax=z_max, |
40 | 40 | extent=[x.min(), x.max(), y.min(), y.max()], |
41 | 41 | interpolation='nearest', origin='lower') |
42 | 42 | plt.title('image (nearest)') |
43 | 43 | plt.colorbar() |
44 | 44 |
|
45 | 45 |
|
46 | 46 | ax = plt.subplot(2, 2, 4) |
47 | | -ax.pcolorfast(x, y, z, vmin=z_min, vmax=z_max) |
| 47 | +ax.pcolorfast(x, y, z, cmap='RdBu', vmin=z_min, vmax=z_max) |
48 | 48 | plt.title('pcolorfast') |
49 | 49 | plt.colorbar() |
50 | 50 |
|
|
0 commit comments