Skip to content

Commit c082308

Browse files
committed
Correction to remove deprecation warning for plt.normalize.
1 parent 36c859e commit c082308

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

examples/pylab_examples/tricontour_vs_griddata.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import numpy as np
88
from numpy.random import uniform, seed
99
from matplotlib.mlab import griddata
10-
from matplotlib.colors import Normalize
1110
import time
1211

1312
seed(0)
@@ -26,7 +25,7 @@
2625
zi = griddata(x, y, z, xi, yi, interp='linear')
2726
plt.contour(xi, yi, zi, 15, linewidths=0.5, colors='k')
2827
plt.contourf(xi, yi, zi, 15, cmap=plt.cm.rainbow,
29-
norm=Normalize(vmax=abs(zi).max(), vmin=-abs(zi).max()))
28+
norm=plt.Normalize(vmax=abs(zi).max(), vmin=-abs(zi).max()))
3029
plt.colorbar() # draw colorbar
3130
plt.plot(x, y, 'ko', ms=3)
3231
plt.xlim(-2, 2)
@@ -41,7 +40,7 @@
4140
triang = tri.Triangulation(x, y)
4241
plt.tricontour(x, y, z, 15, linewidths=0.5, colors='k')
4342
plt.tricontourf(x, y, z, 15, cmap=plt.cm.rainbow,
44-
norm=Normalize(vmax=abs(zi).max(), vmin=-abs(zi).max()))
43+
norm=plt.Normalize(vmax=abs(zi).max(), vmin=-abs(zi).max()))
4544
plt.colorbar()
4645
plt.plot(x, y, 'ko', ms=3)
4746
plt.xlim(-2, 2)

0 commit comments

Comments
 (0)