8000 added rgb, rgba to image · matplotlib/matplotlib@d4ae2c5 · GitHub
[go: up one dir, main page]

Skip to content

Commit d4ae2c5

Browse files
committed
added rgb, rgba to image
svn path=/trunk/matplotlib/; revision=180
1 parent 3d9c781 commit d4ae2c5

File tree

2 files changed

+9
-26
lines changed

2 files changed

+9
-26
lines changed

TODO

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,4 +270,6 @@
270270

271271
-- fix newlines across backends
272272

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

examples/image_demo.py

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,16 @@
44
s = file('data/ct.raw', 'rb').read()
55
A = fromstring(s, typecode=UInt16).astype(Float)
66
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
138
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])
249

10+
# set the interpolation method: 'nearerst', 'bilinear', 'bicubic' and much more
11+
im.set_interpolation('bilinear')
2512

13+
# aspect ratio 'free' or 'preserve'
14+
im.set_aspect('preserve')
2615

27-
#axis('off')
16+
axis('off')
2817
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', [])
3718
show()
3819

0 commit comments

Comments
 (0)
0