|
195 | 195 | "data = state.rand(50, 50).cumsum(axis=1)\n", |
196 | 196 | "# Diverging colormap example\n", |
197 | 197 | "title1 = 'Custom diverging map'\n", |
198 | | - "cmap1 = plot.Colormap('Blue2_r', 'RedPurple1', name='Diverging', save=True)\n", |
| 198 | + "cmap1 = plot.Colormap('Blue5_r', 'RedPurple1', name='Diverging', save=True)\n", |
199 | 199 | "# SciVisColor examples\n", |
200 | 200 | "title2 = 'Custom complex map'\n", |
201 | 201 | "cmap2 = plot.Colormap('Green1_r', 'Orange5', 'Blue1_r',\n", |
|
205 | 205 | " 'Blue6', ratios=(1, 3, 5, 10), name='SciVisColor', save=True)\n", |
206 | 206 | "# Plot examples\n", |
207 | 207 | "for ax, cmap, title in zip(axs, (cmap1, cmap2, cmap3), (title1, title2, title3)):\n", |
208 | | - " m = ax.contourf(data, cmap=cmap, levels=256)\n", |
| 208 | + " func = (ax.pcolormesh if cmap is cmap1 else ax.contourf)\n", |
| 209 | + " m = func(data, cmap=cmap, levels=256)\n", |
209 | 210 | " ax.colorbar(m, loc='b', locator='null', label=cmap.name)\n", |
210 | 211 | " ax.format(title=title)\n", |
211 | 212 | "axs.format(xlabel='xlabel', ylabel='ylabel',\n", |
|
0 commit comments