Re: Colormap in idl -vm [message #38678] |
Wed, 24 March 2004 06:33  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
PJL writes:
> I have this same colormap problem in IDL Virtual Machine on an SGI
> running IRIX 6.5. Adding the DEVICE, DECOMPOSED=0 does not help.
Well, I'm not overly fond of using DEVICE DECOMPOSED
in code anyway. Plays havoc with what you are trying
to do, usually.
I prefer using device-independent color methods. Here is
a Virtual Machine test program that uses FSC_COLOR to
load colors. You can find FSC_COLOR here:
http://www.dfanning.com/programs/fsc_color.pro
Do this:
1. Start a fresh IDL session.
2. Compile VM_TEST
IDL> .compile vm_test
3. Type RESOLVE_ALL:
IDL> Resolve_All
4. Save the routines in a save file:
IDL> Save, Filename='vm_test.sav', /Routines
5. Exit IDL.
Now run the save file in the Virtual Machine. What colors
are you seeing?
Cheers,
David
;**********************************************************
PRO VM_TEST_EVENT, event
Widget_Control, event.top, /Destroy
END
PRO VM_TEST
base = Widget_Base(Column=1)
draw = Widget_Draw(base, XSize=400, YSize=400)
button = Widget_Button(base, Value='Quit')
Widget_Control, base, /Realize
bg = FSC_Color('charcoal', !D.Table_Size-2)
ac = FSC_Color('green', !D.Table_Size-3)
dc = FSC_Color('yellow', !D.Table_Size-4)
Plot, Findgen(11), Background=bg, Color=ac, /NoData
OPlot, Findgen(11), Color=dc
XManager, 'vm_test', base
END
;**********************************************************
--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
|
|
Re: Colormap in idl -vm [message #38683 is a reply to message #38682] |
Tue, 23 March 2004 15:25   |
Yunxiang Zhang
Messages: 19 Registered: October 2003
|
Junior Member |
|
|
Thanks David!
It seems that 'idlde -vm' doesn't really care about my .idl_startup.pro.
And another strange thing is whenever I start the virtual machine, I have
to click the button twice to get to the open sav file dialogue. Was it due
to the latest patch? I can't remember. ^!^
Yunxiang
On Tue, 23 Mar 2004, David Fanning wrote:
> Yunxiang Zhang writes:
>
>> I was not able to make the colormap work properly with idl virtual
>> machine. The image always looks b/w and TVLCT defined color is always
>> black.
>>
>> For example, LOADCT won't do anything and the following code gives me
>> totally black screen. This happens only in virtual machine mode(Linux).
>> :(
>>
>> TVLCT, [[0], [255], [31]], green
>> PLOT, x, my_func, color=green
>>
>> Is it a common problem or I have to know some tricks here? Thanks!
>
> I guess I would have tried this:
>
> TVLCT, [[0], [255], [31]], green
> DEVICE, Decomposed=0
> PLOT, x, my_func, color=green
>
> Does that work any better?
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
>
|
|
|
Re: Colormap in idl -vm [message #38684 is a reply to message #38683] |
Tue, 23 March 2004 14:16   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Yunxiang Zhang writes:
> I was not able to make the colormap work properly with idl virtual
> machine. The image always looks b/w and TVLCT defined color is always
> black.
>
> For example, LOADCT won't do anything and the following code gives me
> totally black screen. This happens only in virtual machine mode(Linux).
> :(
>
> TVLCT, [[0], [255], [31]], green
> PLOT, x, my_func, color=green
>
> Is it a common problem or I have to know some tricks here? Thanks!
I guess I would have tried this:
TVLCT, [[0], [255], [31]], green
DEVICE, Decomposed=0
PLOT, x, my_func, color=green
Does that work any better?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
|