-
Notifications
You must be signed in to change notification settings - Fork 818
/
Copy pathimshow.py
29 lines (24 loc) · 841 Bytes
/
imshow.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from pylab import *
def f(x,y): return (1-x/2+x**5+y**3)*np.exp(-x**2-y**2)
n = 10
x = np.linspace(-3,3,8*n)
y = np.linspace(-3,3,6*n)
X,Y = np.meshgrid(x,y)
Z = f(X,Y)
imshow(Z,interpolation='nearest',cmap='bone', origin='lower')
xticks([]), yticks([])
plt.text(-0.05, 1.05, " Imshow \n\n",
horizontalalignment='left',
verticalalignment='top',
family='Lint McCree Intl BB',
size='x-large',
bbox=dict(facecolor='white', alpha=1.0, width=350,height=60),
transform = gca().transAxes)
plt.text(-0.05, .975, " Display an image to current axes ",
horizontalalignment='left',
verticalalignment='top',
family='Lint McCree Intl BB',
size='medium',
transform = gca().transAxes)
#plt.savefig('../figures/imshow.png', dpi=64)
plt.show()