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

Home » Public Forums » archive » Re: David Fanning's psconfig program
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: David Fanning's psconfig program [message #36598] Mon, 06 October 2003 12:50
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
[This followup was posted to comp.lang.idl-pvwave and a copy was sent to
the cited author.]

David Jackson writes:

> I've been trying to use psconfig and am having a couple of problems.
>
> First, I am plotting colors on a black background. I am using color
> table 4 and in my plot command, I include the keywords color = 255
> (yellow) and background=0 (black). This looks fine on the screen, but
> when I include the psconfig program, I get a white background instead
> of black.

Do you mean you get a white background on your PostScript
output, or on your display screen? I can't see why you would
get this on your display screen, but there are a couple of
things wrong with your program (see below), so maybe when
these are fixed, this will be a non-issue.

> The second problem is that if I include the keyword "fontinfo" in the
> psconfig function, I get an error that says "Keyword CLOSE_FILE not
> allowed in call to: DEVICE" and no postscript file is generated. I
> have included many other keywords in the psconfig function and do not
> get a problem, but as soon as I include fontinfo, I get this error.

This is probably because at the time you are running
the program, your device is not "PS". You forgot to
save the device name in your variable "thisDevice", so
you can't set back to your display.

> Here is the relevant code that I am using:

Here is the code with a couple of changes.

;*****************************************************
pro ferroplot, Postscript=postscript,_Extra=extra
postscript=keyword_set(postscript)

if postscript eq 1 then begin
thisDevice = !D.name
keywords=psconfig(fontinfo=1,fonttype=1,truetype=1,$
times=1,fontsize=16,cancel=cancelled)
IF cancelled THEN RETURN
set_plot,'ps'
device,_Extra=keywords
endif
...
device,decomposed=0
loadct,4
plot, x, y, font=1, color=255, background=0, title='Plot Title'
...
if postscript eq 1 then begin
device,/close_file
set_plot,thisdevice
endif
END
;*****************************************************

Note that your PostScript output can have any background
color you like, as long as it is white. :-)

Cheers,

David



--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@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: David Fanning's psconfig program
Next Topic: Reading and using GrADS format binary data in IDL

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

Current Time: Fri Oct 10 11:43:46 PDT 2025

Total time taken to generate the page: 0.88052 seconds