File tree Expand file tree Collapse file tree 2 files changed +9
-26
lines changed Expand file tree Collapse file tree 2 files changed +9
-26
lines changed Original file line number Diff line number Diff line change 270
270
271
271
-- fix newlines across backends
272
272
273
- -- support partial window expose redraws in agg
273
+ -- DONE - support partial window expose redraws in agg
274
+
275
+ -- Fix datalim problem with aspect preserved for image backend
Original file line number Diff line number Diff line change 4
4
s = file ('data/ct.raw' , 'rb' ).read ()
5
5
A = fromstring (s , typecode = UInt16 ).astype (Float )
6
6
A *= 1.0 / max (A )
7
- A .shape = w , h
8
-
9
- markers = [(15.9 , 14.5 ), (16.8 , 15 )]
10
- x ,y = zip (* markers )
11
- #figure(1, figsize=(2,7))
12
- #pyt subplot(211)
7
+ A .shape = w ,h
13
8
im = imshow (A )
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
9
10
+ # set the interpolation method: 'nearerst', 'bilinear', 'bicubic' and much more
11
+ im .set_interpolation ('bilinear' )
25
12
13
+ # aspect ratio 'free' or 'preserve'
14
+ im .set_aspect ('preserve' )
26
15
27
- # axis('off')
16
+ axis ('off' )
28
17
title ('CT density' )
29
-
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' , [])
37
18
show ()
38
19
You can’t perform that action at this time.
0 commit comments