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

Home » Public Forums » archive » Getting the current color table
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: Getting the current color table [message #46679 is a reply to message #36968] Tue, 06 December 2005 13:55 Go to previous messageGo to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Tue, 06 Dec 2005 10:44:05 -0800, inaki.ugarte wrote:

> Hi,
> is there any recent development in this previously asked question? How do
> I get the color table number used by the last call to LOADCT? I would
> prefer to do it in a general way, without having to call external
> routines.
> Cheers,
> Inaki


I think at some point many years ago this bugged me enough that I wrote a
tool called cload which stores the color table, and the color
min/max/gamma as well, in a custom system variable. I don't use it
anymore, but it might be of interest. If someone else uses LOADCT in the
meantime, you'd be out of luck.

;; load with loadct, but set the !ctabl system variable too.
pro cload, table_number, NO_SET=ns,_REF_EXTRA=e
if n_elements(table_number) ne 0 then begin
loadct,table_number,/SILENT,_EXTRA=e
!ctabl.cmap=table_number
if NOT keyword_set(ns) then begin
!ctabl.high=1.
!ctabl.low=0.
!ctabl.gamma=1.
endif
endif else loadct,_EXTRA=e
end

you have to setup that sysvar first:

pro cdef,_EXTRA=e
defsysv,'!ctabl',Exists=exi
if exi eq 1 then return
;; we need to define it...
;; make and delete window to get the *actual* number of colors used
window,1,xsize=1,ysize=1,/PIXMAP,_EXTRA=e
wdelete
defsysv,'!ctabl',{!ctabl,cmap:0,low:0.,high:1.,gamma:1.0}
return
end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: GRIDSTYLE=1 rendering dependent on graph position?
Next Topic: Re: How does one become an IDL/WAVE consultant?

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

Current Time: Sat Oct 11 14:43:31 PDT 2025

Total time taken to generate the page: 1.52462 seconds