Skip to content

Commit 952d4cb

Browse files
committed
Colormaps demo
1 parent c619caf commit 952d4cb

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

docs/colormaps.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
"data = state.rand(50, 50).cumsum(axis=1)\n",
196196
"# Diverging colormap example\n",
197197
"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",
199199
"# SciVisColor examples\n",
200200
"title2 = 'Custom complex map'\n",
201201
"cmap2 = plot.Colormap('Green1_r', 'Orange5', 'Blue1_r',\n",
@@ -205,7 +205,8 @@
205205
" 'Blue6', ratios=(1, 3, 5, 10), name='SciVisColor', save=True)\n",
206206
"# Plot examples\n",
207207
"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",
209210
" ax.colorbar(m, loc='b', locator='null', label=cmap.name)\n",
210211
" ax.format(title=title)\n",
211212
"axs.format(xlabel='xlabel', ylabel='ylabel',\n",

0 commit comments

Comments
 (0)