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

Home » Public Forums » archive » Re: Setting colors for Plotting to PRINTER
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Setting colors for Plotting to PRINTER [message #26255] Sat, 11 August 2001 20:40
david[2] is currently offline  david[2]
Messages: 100
Registered: June 2001
Senior Member
Aaron Birenboim writes:

> After reviewing Dr. Fanning's code, it appears to me that
> the following should work for a color plot on all non-screen devices
> (or at least the ones where !D.NCOLORS EQ 256) :
>
> TVLCT,255,0,0,22
> PLOT,indgen(9),COLOR=22
>
> To produce a red plot.
> Is this correct????

Yes, for all 8-bit displays.

> --- However, my PS device (at least) still appears black.
> that may be a seperate issue to look into later.

A common mistake is to forget to set the
COLOR keyword when you configure the PostScript
device. You must also set the BITS_PER_PIXEL
keyword to 8. (There are the defaults, by the
way, with PSConfig, which is one of the reasons
I always use it to configure the PostScript device.)

> All that aside....
> There is a special case for 'PRINTER' where fsc_color.pro
> seems to NOT do the TVLCT call.
> How is it that for 'PRINTER' a color gets loaded into index 22....
> when the TVLCT call appears to be skipped?

If there is, I can't seem to find it. :-(

> This is kind of hard for me to test, since I do not have
> a color printer on my development system.
>
> How would the color 22 get set to red for:
>
> SET_PLOT,'PRINTER'
> c = fsc_color('red',22)
> ; i think c would be 22 here
> PLOT,indgen(9),COLOR=c
>
> Is there any place in the IDL documentation that covers
> how to set PLOT colors on non-screen devices?
> Is the PRINTER device somehow different from other
> non-screen devices?

The PRINTER device (depending upon which printer you
are using, of course) is weird. All kinds of strange
things go on with it. For example, I've had little
luck loading colors while inside the PRINTER device.
I almost always have to load colors outside the device,
and copy them into the PRINTER:

Set_Plot, 'PRINTER', /Copy

And then there is a bug in the PRINTER device such
that if you load a single color (e.g. red, in your
example) while in the PRINTER device, the background
shows up in that color. This no matter *what* index
you load the color in. (This doesn't happen on all
printers, thank goodness.)

So, to make your PRINTER example work, I think
you might want to try this:

c = fsc_color('red',22)
SET_PLOT,'PRINTER'm /Copy
PLOT,indgen(9),COLOR=c

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Setting colors for Plotting to PRINTER [message #26256 is a reply to message #26255] Sat, 11 August 2001 19:29 Go to previous message
Aaron Birenboim is currently offline  Aaron Birenboim
Messages: 24
Registered: October 2000
Junior Member
After reviewing Dr. Fanning's code, it appears to me that
the following should work for a color plot on all non-screen devices
(or at least the ones where !D.NCOLORS EQ 256) :

TVLCT,255,0,0,22
PLOT,indgen(9),COLOR=22

To produce a red plot.
Is this correct????

--- However, my PS device (at least) still appears black.
that may be a seperate issue to look into later.

All that aside....
There is a special case for 'PRINTER' where fsc_color.pro
seems to NOT do the TVLCT call.
How is it that for 'PRINTER' a color gets loaded into index 22....
when the TVLCT call appears to be skipped?

This is kind of hard for me to test, since I do not have
a color printer on my development system.

How would the color 22 get set to red for:

SET_PLOT,'PRINTER'
c = fsc_color('red',22)
; i think c would be 22 here
PLOT,indgen(9),COLOR=c

Is there any place in the IDL documentation that covers
how to set PLOT colors on non-screen devices?
Is the PRINTER device somehow different from other
non-screen devices?
--
Aaron Birenboim | Black holes are where G-d divided
Albuquerque, NM | by zero.
aaron@boim.com |
boim.com/~aaron | -Steven Wright
Re: Setting colors for Plotting to PRINTER [message #26257 is a reply to message #26256] Sat, 11 August 2001 09:23 Go to previous message
david[2] is currently offline  david[2]
Messages: 100
Registered: June 2001
Senior Member
Aaron Birenboim writes:

> Thanks for the tip... but are you sharing any info
> about the internals of how FSC_Color might work...
> or sharing the source????

Of course.

http://www.dfanning.com/programs/fsc_color.pro
http://www.dfanning.com/programs/pickcolorname.pro

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Setting colors for Plotting to PRINTER [message #26259 is a reply to message #26257] Sat, 11 August 2001 07:26 Go to previous message
Aaron Birenboim is currently offline  Aaron Birenboim
Messages: 24
Registered: October 2000
Junior Member
David Fanning wrote:
>
> Aaron Birenboim writes:
>
>> Shouldn;t I be able to do something like:
>>
>> SET_PLOT,'PRINTER'
>> TVLCT,255,0,0,2
>> PLOT,myData,COLOR=2
>>
>> To print out a plot in red?
>
> If you were to write your code like this:
>
> PLOT,myData,COLOR=FSC_Color('Red', 2)
>
> Your plot would come out red on your 24-bit
> display and red in your PostScript file,
> and red on your printer. :-)

Thanks for the tip... but are you sharing any info
about the internals of how FSC_Color might work...
or sharing the source????

--
Aaron Birenboim | Black holes are where G-d divided
Albuquerque, NM | by zero.
aaron@boim.com |
boim.com/~aaron | -Steven Wright
Re: Setting colors for Plotting to PRINTER [message #26262 is a reply to message #26259] Fri, 10 August 2001 20:38 Go to previous message
david[2] is currently offline  david[2]
Messages: 100
Registered: June 2001
Senior Member
Aaron Birenboim writes:

> Shouldn;t I be able to do something like:
>
> SET_PLOT,'PRINTER'
> TVLCT,255,0,0,2
> PLOT,myData,COLOR=2
>
> To print out a plot in red?

If you were to write your code like this:

PLOT,myData,COLOR=FSC_Color('Red', 2)

Your plot would come out red on your 24-bit
display and red in your PostScript file,
and red on your printer. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Version Control
Next Topic: color widget

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

Current Time: Wed Oct 08 15:36:27 PDT 2025

Total time taken to generate the page: 0.00375 seconds