Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b3e2e3d

Browse files
committed
PEP8 fixes
1 parent 31a4239 commit b3e2e3d

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

examples/pylab_examples/shading_example.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from matplotlib.colors import LightSource
44
from matplotlib import cbook
55

6-
# Example showing how to make shaded relief plots
6+
# Example showing how to make shaded relief plots
77
# like Mathematica
88
# (http://reference.wolfram.com/mathematica/ref/ReliefPlot.html)
99
# or Generic Mapping Tools
@@ -31,17 +31,19 @@ def compare(z, cmap, ve=1):
3131
# Illuminate the scene from the northwest
3232
ls = LightSource(azdeg=315, altdeg=45)
3333

34-
axes[0,0].imshow(z, cmap=cmap)
35-
axes[0,0].set(xlabel='Colormapped Data')
34+
axes[0, 0].imshow(z, cmap=cmap)
35+
axes[0, 0].set(xlabel='Colormapped Data')
3636

37-
axes[0,1].imshow(ls.hillshade(z, vert_exag=ve), cmap='gray')
38-
axes[0,1].set(xlabel='Illumination Intensity')
37+
axes[0, 1].imshow(ls.hillshade(z, vert_exag=ve), cmap='gray')
38+
axes[0, 1].set(xlabel='Illumination Intensity')
3939

40-
axes[1,0].imshow(ls.shade(z, cmap=cmap, vert_exag=ve, blend_mode='hsv'))
41-
axes[1,0].set(xlabel='Blend Mode: "hsv" (default)')
40+
rgb = ls.shade(z, cmap=cmap, vert_exag=ve, blend_mode='hsv')
41+
axes[1, 0].imshow(rgb)
42+
axes[1, 0].set(xlabel='Blend Mode: "hsv" (default)')
4243

43-
axes[1,1].imshow(ls.shade(z, cmap=cmap, vert_exag=ve, blend_mode='overlay'))
44-
axes[1,1].set(xlabel='Blend Mode: "overlay"')
44+
rgb = ls.shade(z, cmap=cmap, vert_exag=ve, blend_mode='overlay')
45+
axes[1, 1].imshow(rgb)
46+
axes[1, 1].set(xlabel='Blend Mode: "overlay"')
4547

4648
return fig
4749

lib/matplotlib/tests/test_colors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ def test_light_source_topo_surface():
237237
dem = np.load(cbook.get_sample_data('jacksboro_fault_dem.npz'))
238238

239239
# Get the true cellsize in meters for accurate vertical exaggeration
240-
dx, dy = dem['dx'], dem['dy'] # In decimal degrees
241-
# Convert to meters...
240+
# Convert from decimal degrees to meters
241+
dx, dy = dem['dx'], dem['dy']
242242
dx = 111320.0 * dx * np.cos(dem['ymin'])
243243
dy = 111320.0 * dy
244244

0 commit comments

Comments
 (0)