|
1 | | -from matplotlib.image import ASPECT_FREE, ASPECT_PRESERVE |
2 | | -from matplotlib.image import NEAREST, BILINEAR, BICUBIC, SPLINE16 |
3 | 1 | from matplotlib.matlab import * |
4 | 2 |
|
5 | 3 | w, h = 512, 512 |
|
8 | 6 | A *= 1.0/max(A) |
9 | 7 | A.shape = w, h |
10 | 8 |
|
11 | | - |
12 | | -figure(1, figsize=(2,7)) |
13 | | -subplot(211) |
| 9 | +markers = [(15.9, 14.5), (16.8, 15)] |
| 10 | +x,y = zip(*markers) |
| 11 | +#figure(1, figsize=(2,7)) |
| 12 | +#pyt subplot(211) |
14 | 13 | im = imshow(A) |
15 | | -#im.set_interpolation(BICUBIC) |
16 | | -#im.set_interpolation(NEAREST) |
17 | | -im.set_interpolation(BILINEAR) |
18 | | -#im.set_preserve_aspect(ASPECT_PRESERVE) |
19 | | -set(gca(), 'xlim', [0,h-1]) |
20 | | -axis('off') |
| 14 | +im.set_datalimx(0,25) |
| 15 | +im.set_datalimy(0,25) |
| 16 | +#im.set_interpolation('bicubic') |
| 17 | +#im.set_interpolation('nearest') |
| 18 | +im.set_interpolation('bilinear') |
| 19 | +#im.set_aspect('free') |
| 20 | +im.set_aspect('preserve') |
| 21 | +print x, y |
| 22 | +plot(x, y, 'o') |
| 23 | +axis([0,25,0,25]) |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | +#axis('off') |
21 | 28 | title('CT density') |
22 | 29 |
|
23 | | -x = sum(A,0) |
24 | | -subplot(212) |
25 | | -bar(arange(w), x) |
26 | | -set(gca(), 'xlim', [0,h-1]) |
27 | | -ylabel('density') |
28 | | -set(gca(), 'xticklabels', []) |
| 30 | +if 0: |
| 31 | + x = sum(A,0) |
| 32 | + subplot(212) |
| 33 | + bar(arange(w), x) |
| 34 | + set(gca(), 'xlim', [0,h-1]) |
| 35 | + ylabel('density') |
| 36 | + set(gca(), 'xticklabels', []) |
29 | 37 | show() |
30 | 38 |
|
0 commit comments