Re: IDL 8.1 Colorbar Weirdness Continues... [message #77689] |
Sun, 18 September 2011 06:57 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Dave Poreh writes:
> Sounds like back to FSC_Colorbar !!!
Too far back! But, I agree, using the Colorbar()
function is dangerous. I'm going to be sticking
with cgColorbar for the foreseeable future. :-)
Cheers,
David
P.S. I should have an article finished later
today that demonstrates why the Colorbar()
function will almost inevitably lead to
erroneous results.
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: IDL 8.1 Colorbar Weirdness Continues... [message #77690 is a reply to message #77689] |
Sun, 18 September 2011 06:46  |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Sep 18, 5:21 am, sebastian <sebastian.h...@gmail.com> wrote:
> Hi David,
>
> I have noticed the same, since I was in the same situation (2 images 1
> plot with the same colorbar).
>
> If you look into "IDLitVisColorbar__Define" you can see that a
> colorbar can only be attached to *one* image. And the data will always
> be scaled between 0 and 255, which is also not very helpful if the
> colortable has only e.g. 100 colors. I ended up using direct graphics
> for my plots :/
>
> Cheers,
> Sebastian
Sounds like back to FSC_Colorbar !!!
|
|
|
Re: IDL 8.1 Colorbar Weirdness Continues... [message #77691 is a reply to message #77690] |
Sun, 18 September 2011 05:21  |
sh
Messages: 26 Registered: April 2010
|
Junior Member |
|
|
Hi David,
I have noticed the same, since I was in the same situation (2 images 1
plot with the same colorbar).
If you look into "IDLitVisColorbar__Define" you can see that a
colorbar can only be attached to *one* image. And the data will always
be scaled between 0 and 255, which is also not very helpful if the
colortable has only e.g. 100 colors. I ended up using direct graphics
for my plots :/
Cheers,
Sebastian
|
|
|
Re: IDL 8.1 Colorbar Weirdness Continues... [message #77693 is a reply to message #77691] |
Sat, 17 September 2011 10:00  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> I am trying to write an article about how the IDL 8.1
> Colorbar() function actually works. This is becoming
> *extremely* difficult!
Oh, my gosh! The situation is even worse than I thought!
Look at this.
IDL> img = Read_Image(file)
IDL> img = Scale_Vector(img, 80, 200)
IDL> help, img
IMG FLOAT = Array[250, 250]
IDL> imgObj = Image(img, Position=[0.1, 0.1, 0.9, 0.8])
IDL> cb = Colorbar(Target=imgObj,Position=[0.1, 0.85, 0.9, 0.88])
IDL> maxmin, img
% Compiled module: MAXMIN.
MaxMin: 200.000 80.0000
IDL> img = Byte(img)
IDL> maxmin, img
MaxMin: 200 80
IDL> imgObj = Image(img, Position=[0.1, 0.1, 0.9, 0.8])
IDL> cb = Colorbar(Target=imgObj,Position=[0.1, 0.85, 0.9, 0.88])
You can see that by attaching the color bar to the image,
that the image is actually scaled to the values in the
color bar. I suppose, given this color bar design, that
this is what you would want to happen.
But, what this means is that Mark Piper's method of
"correcting" the color bars labels by using the
TICKNAME keyword is *never* going to work. In fact,
it will ALWAYS result in some colors of the image
being represented incorrectly. You won't be able
to believe ANYTHING you see!
This is a serious, serious deficiency in this
Colorbar() function! And I suspect, although I
can't prove it yet, that this goes all the way
down into the Image() function as well.
My God, I would not be using function graphics to
do important science!
Cheers,
David
P.S. I hope I am wrong about all this, but I don't
see any evidence at the moment that I am. :-(
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|