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

Home » Public Forums » archive » 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: Current color table [message #91528 is a reply to message #91525] Fri, 24 July 2015 07:15 Go to previous messageGo to previous message
a146397258 is currently offline  a146397258
Messages: 7
Registered: July 2015
Junior Member
On Thursday, July 23, 2015 at 4:03:37 PM UTC-6, jim...@gmail.com wrote:
> On Monday, July 20, 2015 at 10:59:28 AM UTC-6, a1463...@gmail.com wrote:
>> When the user clicks a button, the program executes xloadct, allowing them to then select and/or modify a color table. I would like to have a small piece of text below the button that indicates the currently loaded color table. Where would the current color table index and its name be stored? I can't find it anywhere. I also need the table number to preserve the current color table, as the script executes a color plot, and then a different plot which must be black and white. In between runs I don't want the user to have to reselect the color table, but unfortunately it is reverted to black and white to properly generate the second plot. There's probably something simple I am missing...
>
> Hi, would an approach like the following work for you?
>
> xloadct, /block
> tvlct, r, g, b, /get
> loadct, get_names=ctnames
> tvlct, r, g, b, /get
> ct = [[r],[g],[b]]
>
> for i=0, n_elements(ctnames)-1 do $
> if array_equal(ct, colortable(i)) then begin
> print,strtrim(i,1),' : ',ctnames[i]
> break
> endif
>
> end

Wow, fantastic. Thank you very much.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: External development: Populating a complex array in C
Next Topic: HELP adding arrays

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

Current Time: Wed Oct 08 11:49:57 PDT 2025

Total time taken to generate the page: 0.00462 seconds