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 
Return to the default flat view Create a new topic Submit Reply
Re: Setting colors for Plotting to PRINTER [message #26255] Sat, 11 August 2001 20:40 Go to previous message
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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Version Control
Next Topic: color widget

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

Current Time: Wed Oct 08 15:32:47 PDT 2025

Total time taken to generate the page: 0.00584 seconds