Skip to content

Commit 45af39b

Browse files
committed
MEP12 on image_origin.py
1 parent 4c4852d commit 45af39b

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed
+13-13
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
#!/usr/bin/env python
21
"""
32
You can specify whether images should be plotted with the array origin
43
x[0,0] in the upper left or upper right by using the origin parameter.
54
You can also control the default be setting image.origin in your
65
matplotlibrc file; see http://matplotlib.org/matplotlibrc
76
"""
8-
from pylab import *
7+
import matplotlib.pyplot as plt
8+
import numpy as np
99

10-
x = arange(100.0)
10+
x = np.arange(100.0)
1111
x.shape = (10, 10)
1212

1313
interp = 'bilinear'
14-
#interp = 'nearest'
14+
# interp = 'nearest'
1515
lim = -2, 11, -2, 6
16-
subplot(211, axisbg='g')
17-
title('blue should be up')
18-
imshow(x, origin='upper', interpolation=interp)
19-
#axis(lim)
16+
plt.subplot(211, axisbg='g')
17+
plt.title('blue should be up')
18+
plt.imshow(x, origin='upper', interpolation=interp)
19+
# plt.axis(lim)
2020

21-
subplot(212, axisbg='y')
22-
title('blue should be down')
23-
imshow(x, origin='lower', interpolation=interp)
24-
#axis(lim)
25-
show()
21+
plt.subplot(212, axisbg='y')
22+
plt.title('blue should be down')
23+
plt.imshow(x, origin='lower', interpolation=interp)
24+
# plt.axis(lim)
25+
plt.show()

0 commit comments

Comments
 (0)