10000 Fix NumPy warnings in some demos. · matplotlib/matplotlib@8d29391 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8d29391

Browse files
committed
Fix NumPy warnings in some demos.
1 parent 3d59711 commit 8d29391

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

examples/event_handling/lasso_demo.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ def __init__(self, ax, data):
3838

3939
facecolors = [d.color for d in data]
4040
self.xys = [(d.x, d.y) for d in data]
41-
fig = ax.figure
4241
self.collection = RegularPolyCollection(
43-
fig.dpi, 6, sizes=(100,),
42+
6, sizes=(100,),
4443
facecolors=facecolors,
4544
offsets=self.xys,
4645
transOffset=ax.transData)

examples/images_contours_and_fields/streamplot_demo_masking.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
speed = np.sqrt(U*U + V*V)
1515

1616
mask = np.zeros(U.shape, dtype=bool)
17-
mask[40:60, 40:60] = 1
18-
U = np.ma.array(U, mask=mask)
17+
mask[40:60, 40:60] = True
1918
U[:20, :20] = np.nan
19+
U = np.ma.array(U, mask=mask)
2020

2121
fig, ax = plt.subplots()
2222
ax.streamplot(X, Y, U, V, color='r')

0 commit comments

Comments
 (0)
0