8000 PEP8 scatter examples · matplotlib/matplotlib@6e9e271 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6e9e271

Browse files
committed
PEP8 scatter examples
1 parent 884c1fa commit 6e9e271

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

examples/lines_bars_and_markers/scatter_custom_symbol.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
# unit area ellipse
1212
rx, ry = 3., 1.
1313
area = rx * ry * pi
14-
theta = arange(0, 2*pi + 0.01, 0.1)
15-
verts = list(zip(rx/area*cos(theta), ry/area*sin(theta)))
14+
theta = arange(0, 2 * pi + 0.01, 0.1)
15+
verts = list(zip(rx / area * cos(theta), ry / area * sin(theta)))
1616

1717
x, y, s, c = rand(4, 30)
1818
s *= 10**2.

examples/lines_bars_and_markers/scatter_demo2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
price_data = np.load(datafile)['price_data'].view(np.recarray)
1717
price_data = price_data[-250:] # get the most recent 250 trading days
1818

19-
delta1 = np.diff(price_data.adj_close)/price_data.adj_close[:-1]
19+
delta1 = np.diff(price_data.adj_close) / price_data.adj_close[:-1]
2020

2121
# Marker size in units of points^2
2222
volume = (15 * price_data.volume[:-2] / price_data.volume[0])**2

examples/lines_bars_and_markers/scatter_masked.py

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

1414
N = 100
1515
r0 = 0.6
16-
x = 0.9*np.random.rand(N)
17-
y = 0.9*np.random.rand(N)
18-
area = np.pi*(10 * np.random.rand(N))**2 # 0 to 10 point radii
16+
x = 0.9 * np.random.rand(N)
17+
y = 0.9 * np.random.rand(N)
18+
area = np.pi * (10 * np.random.rand(N))**2 # 0 to 10 point radii
1919
c = np.sqrt(area)
20-
r = np.sqrt(x*x + y*y)
20+
r = np.sqrt(x * x + y * y)
2121
area1 = np.ma.masked_where(r < r0, area)
2222
area2 = np.ma.masked_where(r >= r0, area)
2323
plt.scatter(x, y, s=area1, marker='^', c=c)
2424
plt.scatter(x, y, s=area2, marker='o', c=c)
2525
# Show the boundary between the regions:
26-
theta = np.arange(0, np.pi/2, 0.01)
27-
plt.plot(r0*np.cos(theta), r0*np.sin(theta))
26+
theta = np.arange(0, np.pi / 2, 0.01)
27+
plt.plot(r0 * np.cos(theta), r0 * np.sin(theta))
2828

2929
plt.show()

examples/lines_bars_and_markers/scatter_profile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929

3030
for N in (20, 100, 1000, 10000, 50000):
3131
tstart = time.time()
32-
x = 0.9*np.random.rand(N)
33-
y = 0.9*np.random.rand(N)
34-
s = 20*np.random.rand(N)
32+
x = 0.9 * np.random.rand(N)
33+
y = 0.9 * np.random.rand(N)
34+
s = 20 * np.random.rand(N)
3535
plt.scatter(x, y, s)
3636
print('%d symbols in %1.2f s' % (N, time.time() - tstart))

examples/lines_bars_and_markers/scatter_star_poly.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
plt.subplot(323)
2626
plt.scatter(x, y, s=80, c=z, marker=(verts, 0))
2727
# equivalent:
28-
#plt.scatter(x,y,s=80, c=z, marker=None, verts=verts)
28+
# plt.scatter(x,y,s=80, c=z, marker=None, verts=verts)
2929

3030
plt.subplot(324)
3131
plt.scatter(x, y, s=80, c=z, marker=(5, 1))

0 commit comments

Comments
 (0)
0