Mercurial > octave-nkf
comparison scripts/image/imshow.m @ 10648:bc4eb29e0cb4
Scale image point color according to colormap. Bug #29926.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 23 May 2010 17:11:50 -0700 |
parents | 2c01d24459fb |
children | be55736a0783 |
comparison
equal
deleted
inserted
replaced
10647:5c6b73a844e4 | 10648:bc4eb29e0cb4 |
---|---|
62 true_color = false; | 62 true_color = false; |
63 indexed = false; | 63 indexed = false; |
64 | 64 |
65 ## Get the image. | 65 ## Get the image. |
66 if (ischar (im)) | 66 if (ischar (im)) |
67 ## Eventually, this should be imread. | |
68 [im, map] = imread (im); | 67 [im, map] = imread (im); |
69 indexed = true; | 68 indexed = true; |
70 colormap (map); | 69 colormap (map); |
71 endif | 70 endif |
72 | 71 |
163 endif | 162 endif |
164 | 163 |
165 if (true_color || indexed) | 164 if (true_color || indexed) |
166 tmp = image ([], [], im); | 165 tmp = image ([], [], im); |
167 else | 166 else |
168 tmp = image (round ((rows (colormap ()) - 1) * im)); | 167 tmp = image (im); |
168 set (tmp, "cdatamapping", "scaled"); | |
169 endif | 169 endif |
170 set (gca (), "visible", "off"); | 170 set (gca (), "visible", "off"); |
171 axis ("image"); | 171 axis ("image"); |
172 | 172 |
173 if (nargout > 0) | 173 if (nargout > 0) |