8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d4ae2c5 commit 85d9a95Copy full SHA for 85d9a95
examples/image_demo2.py
@@ -0,0 +1,32 @@
1
+from matplotlib.matlab import *
2
+
3
+w, h = 512, 512
4
+s = file('data/ct.raw', 'rb').read()
5
+A = fromstring(s, typecode=UInt16).astype(Float)
6
+A *= 1.0/max(A)
7
+A.shape = w, h
8
9
+im = imshow(A)
10
+im.set_aspect('free')
11
12
+# plot some data with the image; currently broken with aspect preserve
13
+gca().set_image_extent(0, 25, 0, 25)
14
+markers = [(15.9, 14.5), (16.8, 15)]
15
+x,y = zip(*markers)
16
+plot(x, y, 'o')
17
+#axis([0,25,0,25])
18
19
20
21
+#axis('off')
22
+title('CT density')
23
24
+if 0:
25
+ x = sum(A,0)
26
+ subplot(212)
27
+ bar(arange(w), x)
28
+ set(gca(), 'xlim', [0,h-1])
29
+ ylabel('density')
30
+ set(gca(), 'xticklabels', [])
31
+show()
32
0 commit comments