Skip to content

Commit e0dcff7

Browse files
committed
Tweaked flake8 issues
1 parent b01d03c commit e0dcff7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

examples/images_contours_and_fields/colormap_normalizations_symlognorm.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,18 @@
2222
import matplotlib.pyplot as plt
2323
import matplotlib.colors as colors
2424

25+
26+
def rbf(x, y):
27+
return 1.0 / (1 + 5 * ((x ** 2) + (y ** 2)))
28+
2529
N = 200
2630
gain = 8
2731
X, Y = np.mgrid[-3:3:complex(0, N), -2:2:complex(0, N)]
28-
rbf = lambda x, y: 1.0 / (1 + 5 * ((x ** 2) + (y ** 2)))
2932
Z1 = rbf(X + 0.5, Y + 0.5)
3033
Z2 = rbf(X - 0.5, Y - 0.5)
3134
Z = gain * Z1 - Z2
3235

33-
shadeopts = { 'cmap': 'PRGn', 'shading': 'gouraud' }
36+
shadeopts = {'cmap': 'PRGn', 'shading': 'gouraud'}
3437
colormap = 'PRGn'
3538
lnrwidth = 0.2
3639

@@ -66,14 +69,14 @@
6669

6770
pcm = ax[0].pcolormesh(X, Y, Z,
6871
norm=colors.SymLogNorm(linthresh=lnrwidth, linscale=1,
69-
vmin=-gain, vmax=gain, base=10),
72+
vmin=-2, vmax=gain, base=10),
7073
**shadeopts)
7174
fig.colorbar(pcm, ax=ax[0], extend='both')
7275
ax[0].text(-2.5, 1.5, 'symlog')
7376

7477
pcm = ax[1].pcolormesh(X, Y, Z,
7578
norm=colors.AsinhNorm(linear_width=lnrwidth,
76-
vmin=-gain, vmax=gain),
79+
vmin=-2, vmax=gain),
7780
**shadeopts)
7881
fig.colorbar(pcm, ax=ax[1], extend='both')
7982
ax[1].text(-2.5, 1.5, 'asinh')

0 commit comments

Comments
 (0)