[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #36594] imshow error after changing colormap
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #36594] imshow error after changing colormap |
Date: |
Thu, 07 Jun 2012 15:49:56 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:12.0) Gecko/20100101 Firefox/12.0 |
Update of bug #36594 (project octave):
Status: None => Confirmed
_______________________________________________________
Follow-up Comment #1:
There are several bugs interacting with each other here.
First, are you using FLTK or gnuplot as the graphics toolkit for imshow? My
guess is that you are using FLTK which has a strange issue here.
Second, full support for uint8 images will probably come in version 3.8.0 of
Octave. For the moment, it would be better to use images of class double. To
convert use the following:
im_dbl = double (im_uint8) + 1;
The addition of 1 is necessary because double images index into the colormap
starting with 1, not 0.
Finally, it appears to me that the data has been correctly plotted but the
axis limits are incorrect. The test image/matrix you plotted had four values
and so the xlimits were set at [1, 4]. The following command sets correct
limits which reproduces the entire image.
xlim ([0.5, 4.5])
In order to help debug this, could you run the following code under Matlab? I
want to verify what axis limits get set.
im=uint8([0 1 2 0; 0 1 2 0; 0 1 2 0; 0 1 2 0]);
map=[0 0 0; 1 0 0; 0 1 0; 0 0 1; 1 1 0; 0 1 1 ; 1 0 1];
im_dbl = double (im) + 1;
colormap (map);
image ([], [], im_dbl);
xlim1 = xlim
axis ('equal');
xlim2 = xlim
axis ('tight');
xlim3 = xlim
axis ('image');
xlim4 = xlim
clf;
imshow (im_dbl, map);
xlim5 = xlim
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?36594>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/