comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Log-scaled colorbar example
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Log-scaled colorbar example [message #76251 is a reply to message #76220] Mon, 23 May 2011 08:37 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Kim writes:

> After several unsuccessful attempts at trying to generate a log-scaled
> colorbar using the COLORBAR function, I came up with a way to manually
> create the colorbar. If someone could please look at the code and let
> me know if this seems correct I would really appreciate it.

Well, your plots are beautiful, but I am not sure they
are correct. :-)

Here is code that I *know* produces the correct result:

image = cgDemoData(7) ; World Elevation Data
image = Scale_Vector(image, 1, 2500L)
logImage = Alog10(image)
s = Size(image, /Dimensions)
cgDisplay, 600, 400, Title='Logarithmic Color Bar'
LoadCT, 33, /Silent, NColors=254
pos = [0.1, 0.1, 0.8, 0.9]
cgImage, BytScl(logImage, Top=253), Position=pos, /Keep_Aspect
cgPlot, [0], [0], /NoErase, XRange=[0,s[0]], YRange=[0,s[1]], $
XStyle=1, YStyle=1, Color=cgColor('black', 255), Position=pos
cgColorbar, /YLOG, YTICKS=0, Range=[Min(image), Max(image)], $
NColors=254, Color=cgColor('black', 255), /Vertical
END

How do I know? I can check it.

IDL> cgImageInfo, image

You can click in the graphics window and the image position
and value will be printed in the command log. (Right click
to exit the cgImageInfo program.) You can clearly see that
the image value corresponds to the colors on the color bar.

Can you reproduce this figure and color bar with your
code? (I haven't been able to, but I've spent less than
an hour trying.) When you can reproduce this figure, then
I think you are on the right track.

Cheers,

David



--
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.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Displaying thicker lines on an image
Next Topic: Re: IDL for dummies

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 08:53:00 PDT 2025

Total time taken to generate the page: 0.72448 seconds