Skip to content

Commit 8d7c2ad

Browse files
committed
Fixed SymlogNorm demo to actually use positive & negative values
1 parent 9fd8b0c commit 8d7c2ad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/images_contours_and_fields/colormap_normalizations_symlognorm.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@
2525
X, Y = np.mgrid[-3:3:complex(0, N), -2:2:complex(0, N)]
2626
Z1 = np.exp(-X**2 - Y**2)
2727
Z2 = np.exp(-(X - 1)**2 - (Y - 1)**2)
28-
Z = (5 * Z1 - Z2) * 2
28+
Z = 5 * Z1 - Z2
2929

3030
fig, ax = plt.subplots(2, 1)
3131

3232
pcm = ax[0].pcolormesh(X, Y, Z,
33-
norm=colors.SymLogNorm(linthresh=0.03, linscale=0.03,
34-
vmin=-1.0, vmax=1.0, base=10),
33+
norm=colors.SymLogNorm(linthresh=0.5, linscale=1,
34+
vmin=-5, vmax=5, base=10),
3535
cmap='RdBu_r', shading='nearest')
3636
fig.colorbar(pcm, ax=ax[0], extend='both')
3737

38-
pcm = ax[1].pcolormesh(X, Y, Z, cmap='RdBu_r', vmin=-np.max(Z),
38+
pcm = ax[1].pcolormesh(X, Y, Z, cmap='RdBu_r', vmin=-5, vmax=5,
3939
shading='nearest')
4040
fig.colorbar(pcm, ax=ax[1], extend='both')
4141

0 commit comments

Comments
 (0)