-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoge_image!.py
More file actions
51 lines (31 loc) · 1.13 KB
/
doge_image!.py
File metadata and controls
51 lines (31 loc) · 1.13 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env python
# coding: utf-8
import matplotlib.pyplot as plt
doge = plt.imread('doge.jpg')
plt.imshow(doge) #doge source:https://www.google.com/search?q=doge&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjl4KqLl5njAhWC1lkKHS8kByMQ_AUIECgB&biw=1349&bih=653#imgrc=UWBEFPaDlht07M:
print(doge.shape)
doge_2d = doge.sum(axis=2)
print(doge_2d.shape)
# # Colorful doges!!
plt.imshow(doge_2d,cmap='ocean')
plt.imshow(doge_2d,cmap='autumn')
plt.imshow(doge_2d,cmap='PuBu')
plt.imshow(doge_2d,cmap='gray')
plt.imshow(doge_2d,cmap='plasma')
# # Extent and aspect
plt.imshow(doge_2d,extent=(-1,1,-1,1), aspect=0.5)
plt.imshow(doge_2d,extent=(-1,1,-1,1), aspect=2)
plt.imshow(doge_2d,extent=(-2,2,-1,1), aspect=2)
plt.imshow(doge_2d,extent=(-10,10,-10,10), aspect=1)
plt.subplot(2,2,1)
plt.title('-1,1,-1,1/0.5')
plt.imshow(doge_2d,extent=(-1,1,-1,1), aspect=0.5)
plt.subplot(2,2,2)
plt.title('-1,1,-1,1/2')
plt.imshow(doge_2d,extent=(-1,1,-1,1), aspect=2)
plt.subplot(2,2,3)
plt.title('-2,2,-1,1/2')
plt.imshow(doge_2d,extent=(-2,2,-1,1), aspect=2)
plt.subplot(2,2,4)
plt.title('-10,10,-10,10/1')
plt.imshow(doge_2d,extent=(-10,10,-10,10), aspect=1)