Skip to content

Commit b183c1a

Browse files
committed
Merge pull request matplotlib#4980 from ericmjl/mep12-image_interp.py
Mep12 image interp.py
2 parents 9d7ee27 + 0d2332f commit b183c1a

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

examples/pylab_examples/image_interp.py

+14-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python
21
"""
32
The same (small) array, interpolated with three different
43
interpolation methods.
@@ -46,18 +45,20 @@
4645
suggested.
4746
4847
"""
49-
from pylab import *
50-
A = rand(5, 5)
51-
figure(1)
52-
imshow(A, interpolation='nearest')
53-
grid(True)
48+
import matplotlib.pyplot as plt
49+
import numpy as np
5450

55-
figure(2)
56-
imshow(A, interpolation='bilinear')
57-
grid(True)
51+
A = np.random.rand(5, 5)
52+
plt.figure(1)
53+
plt.imshow(A, interpolation='nearest')
54+
plt.grid(True)
5855

59-
figure(3)
60-
imshow(A, interpolation='bicubic')
61-
grid(True)
56+
plt.figure(2)
57+
plt.imshow(A, interpolation='bilinear')
58+
plt.grid(True)
6259

63-
show()
60+
plt.figure(3)
61+
plt.imshow(A, interpolation='bicubic')
62+
plt.grid(True)
63+
64+
plt.show()

0 commit comments

Comments
 (0)