8000 pep8 fix e2* in examples dir part 2/2 · UIKit0/matplotlib@b680680 · GitHub
[go: up one dir, main page]

Skip to content

Commit b680680

Browse files
committed
pep8 fix e2* in examples dir part 2/2
Signed-off-by: Thomas Hisch <t.hisch@gmail.com>
1 parent cc7fc7f commit b680680

32 files changed

+97
-91
lines changed

examples/pylab_examples/scatter_custom_symbol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# unit area ellipse
66
rx, ry = 3., 1.
77
area = rx * ry * pi
8-
theta = arange(0, 2*pi+0.01, 0.1)
8+
theta = arange(0, 2*pi + 0.01, 0.1)
99
verts = list(zip(rx/area*cos(theta), ry/area*sin(theta)))
1010

1111
x, y, s, c = rand(4, 30)

examples/pylab_examples/scatter_hist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# definitions for the axes
1212
left, width = 0.1, 0.65
1313
bottom, height = 0.1, 0.65
14-
bottom_h = left_h = left+width+0.02
14+
bottom_h = left_h = left + width + 0.02
1515

1616
rect_scatter = [left, bottom, width, height]
1717
rect_histx = [left, bottom_h, width, 0.2]

examples/pylab_examples/scatter_masked.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
y = 0.9*rand(N)
88
area = pi*(10 * rand(N))**2 # 0 to 10 point radiuses
99
c = sqrt(area)
10-
r = sqrt(x*x+y*y)
10+
r = sqrt(x*x + y*y)
1111
area1 = ma.masked_where(r < r0, area)
1212
area2 = ma.masked_where(r >= r0, area)
1313
scatter(x, y, s=area1, marker='^', c=c, hold='on')

examples/pylab_examples/scatter_profile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
y = 0.9*pylab.rand(N)
2222
s = 20*pylab.rand(N)
2323
pylab.scatter(x, y, s)
24-
print('%d symbols in %1.2f s' % (N, time.time()-tstart))
24+
print('%d symbols in %1.2f s' % (N, time.time() - tstart))

examples/pylab_examples/simple_plot_fps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
ion()
1212

13-
t = arange(0.0, 1.0+0.001, 0.001)
13+
t = arange(0.0, 1.0 + 0.001, 0.001)
1414
s = cos(2*2*pi*t)
1515
plot(t, s, '-', lw=2)
1616

examples/pylab_examples/stackplot_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import numpy as np
22
from matplotlib import pyplot as plt
33

4-
fnx = lambda : np.random.randint(5, 50, 10)
4+
fnx = lambda: np.random.randint(5, 50, 10)
55
y = np.row_stack((fnx(), fnx(), fnx()))
66
x = np.arange(10)
77

examples/pylab_examples/system_monitor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66

77
def get_memory():
88
"Simulate a function that returns system memory"
9-
return 100*(0.5+0.5*sin(0.5*pi*time.time()))
9+
return 100*(0.5 + 0.5*sin(0.5*pi*time.time()))
1010

1111

1212
def get_cpu():
1313
"Simulate a function that returns cpu usage"
14-
return 100*(0.5+0.5*sin(0.2*pi*(time.time()-0.25)))
14+
return 100*(0.5 + 0.5*sin(0.2*pi*(time.time() - 0.25)))
1515

1616

1717
def get_net():
1818
"Simulate a function that returns network bandwidth"
19-
return 100*(0.5+0.5*sin(0.7*pi*(time.time()-0.1)))
19+
return 100*(0.5 + 0.5*sin(0.7*pi*(time.time() - 0.1)))
2020

2121

2222
def get_stats():

examples/pylab_examples/tex_unicode_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
figure(1, figsize=(6, 4))
1616
ax = axes([0.1, 0.1, 0.8, 0.7])
17-
t = arange(0.0, 1.0+0.01, 0.01)
18-
s = cos(2*2*pi*t)+2
17+
t = arange(0.0, 1.0 + 0.01, 0.01)
18+
s = cos(2*2*pi*t) + 2
1919
plot(t, s)
2020

2121
xlabel(r'\textbf{time (s)}')

examples/pylab_examples/tricontour_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
y = xy[:, 1]*180/3.14159
7070
x0 = -5
7171
y0 = 52
72-
z = np.exp(-0.01*((x-x0)*(x-x0) + (y-y0)*(y-y0)))
72+
z = np.exp(-0.01*((x - x0)*(x - x0) + (y - y0)*(y - y0)))
7373

7474
triangles = np.asarray([
7575
[67, 66, 1], [65, 2, 66], [1, 66, 2], [64, 2, 65], [63, 3, 64],

examples/pylab_examples/tricontour_smooth_delaunay.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@
3030
def experiment_res(x, y):
3131
""" An analytic function representing experiment results """
3232
x = 2.*x
33-
r1 = np.sqrt((0.5-x)**2 + (0.5-y)**2)
34-
theta1 = np.arctan2(0.5-x, 0.5-y)
35-
r2 = np.sqrt((-x-0.2)**2 + (-y-0.2)**2)
36-
theta2 = np.arctan2(-x-0.2, -y-0.2)
37-
z = (4*(np.exp((r1/10)**2)-1)*30. * np.cos(3*theta1) +
38-
(np.exp((r2/10)**2)-1)*30. * np.cos(5*theta2) +
33+
r1 = np.sqrt((0.5 - x)**2 + (0.5 - y)**2)
34+
theta1 = np.arctan2(0.5 - x, 0.5 - y)
35+
r2 = np.sqrt((-x - 0.2)**2 + (-y - 0.2)**2)
36+
theta2 = np.arctan2(-x - 0.2, -y - 0.2)
37+
z = (4*(np.exp((r1/10)**2) - 1)*30. * np.cos(3*theta1) +
38+
(np.exp((r2/10)**2) - 1)*30. * np.cos(5*theta2) +
3939
2*(x**2 + y**2))
40-
return (np.max(z)-z)/(np.max(z)-np.min(z))
40+
return (np.max(z) - z)/(np.max(z) - np.min(z))
4141

4242
#-----------------------------------------------------------------------------
4343
# Generating the initial data test points and triangulation for the demo

0 commit comments

Comments
 (0)
0