octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Colour scaling in imshow


From: Jordi Gutiérrez Hermoso
Subject: Re: Colour scaling in imshow
Date: Mon, 17 Jan 2011 12:22:54 -0600

2011/1/16 John W. Eaton <address@hidden>:
> On 16-Jan-2011, Jordi Gutiérrez Hermoso wrote:
>
> | There's currently a bug in imshow where
> |
> |      x =rand(100:
> |      imshow(x);
> |      figure;
> |      imshow(x,[0,255]);
> |
> | produces two identical images, whereas the second one should be almost
> | black. Attached is a patch that seems to fix this. I'm not sure this
> | is the right fix, so I won't push it right away. Notice that I also
> | had to ensure that display_range was a double despite the warnings in
> | the code that it was wrong to do. Without it, the scaling operations
> | that use display_range were not working properly, due to the vagaries
> | of integer division.
> |
> | I'm not completely sure the attached patch is the correct one, so I'll
> | wait for review before pushing it.
>
> Does Matlab set clim to [0, 1] for this case?  If not, then this is
> not the right fix.

Asking around in the ##matlab channel in IRC, it appears that imshow
does indeed set the clim property of the parent axes object to [0,1].
A fun side effect of that conversation is that apparently imshow
should return a handle to the image, not to the parent axis object,
like our current imshow implementation does. I saw that imshow should
also accept property-value pairs to set any of its properties.

Can someone with Matlab access please confirm?

- Jordi G. H.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]