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

Skip to content

Commit cb41936

Browse files
committed
Minor style fixes in plot types
1 parent dad3d77 commit cb41936

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

plot_types/arrays/imshow.py

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

1414
# make data
1515
X, Y = np.meshgrid(np.linspace(-3, 3, 256), np.linspace(-3, 3, 256))
16-
Z = (1 - X/2. + X**5 + Y**3) * np.exp(-X**2 - Y**2)
16+
Z = (1 - X/2 + X**5 + Y**3) * np.exp(-X**2 - Y**2)
1717
Z = Z[::16, ::16]
1818

1919
# plot

plot_types/arrays/pcolormesh.py

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

1515
# make full-res data
1616
X, Y = np.meshgrid(np.linspace(-3, 3, 256), np.linspace(-3, 3, 256))
17-
Z = (1 - X/2. + X**5 + Y**3) * np.exp(-X**2 - Y**2)
17+
Z = (1 - X/2 + X**5 + Y**3) * np.exp(-X**2 - Y**2)
1818

1919
# sample unevenly in x:
2020
dx = np.sqrt((np.arange(16) - 8)**2) + 6

plot_types/arrays/streamplot.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@
1212

1313
# make a stream function:
1414
X, Y = np.meshgrid(np.linspace(-3, 3, 256), np.linspace(-3, 3, 256))
15-
Z = (1 - X/2. + X**5 + Y**3) * np.exp(-X**2 - Y**2)
15+
Z = (1 - X/2 + X**5 + Y**3) * np.exp(-X**2 - Y**2)
1616
# make U and V out of the streamfunction:
1717
V = np.diff(Z[1:, :], axis=1)
1818
U = -np.diff(Z[:, 1:], axis=0)
1919

2020
# plot:
2121
fig, ax = plt.subplots()
2222

23-
# plot stream plot
2423
ax.streamplot(X[1:, 1:], Y[1:, 1:], U, V)
2524

2625
plt.show()

0 commit comments

Comments
 (0)