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

Home » Public Forums » archive » Trouble using Coyote Graphics library to write PostScript file - keywords from cgps_config aren't accepted by cgps_open
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
Trouble using Coyote Graphics library to write PostScript file - keywords from cgps_config aren't accepted by cgps_open [message #87825] Thu, 27 February 2014 10:19 Go to next message
Jasdeep Anand is currently offline  Jasdeep Anand
Messages: 16
Registered: August 2011
Junior Member
I'm trying to create a PostScript file with the intention of converting it into a 1000x800 pixel .png image (I'm doing this because I'm having difficulty with using WRITE_PNG to output plots with labels in Times New Roman without the words looking pixelated).

To do this I've tried defining a window in IDL and then using cpgs_config to record the necessary window information before passing it to cgps_open, as described on David Fanning's page: http://www.idlcoyote.com/ps_tips/ps_aspect.php, like so:

WINDOW, XSize=1000, YSize=800
dat_window = cgps_config()
cgPS_Open, FILENAME='Test_ps.ps', TT_FONT = 'Times', CHARSIZE = 2.0,_REF_EXTRA = dat_window

However, the program fails at the last line, outputting an error message: "Keyword FONT_SIZE not allowed in call to: CGPS_CONFIG". Is there any way to not have this variable outputted by cgps_config? Alternatively, is there any other way of creating a PostScript file that will convert to a 1000x800 pixel PNG file? I'd be grateful for any advice anyone could give me.
Re: Trouble using Coyote Graphics library to write PostScript file - keywords from cgps_config aren't accepted by cgps_open [message #87826 is a reply to message #87825] Thu, 27 February 2014 10:42 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
jasdeepsinghanand@googlemail.com writes:

> I'm trying to create a PostScript file with the intention of converting it into a 1000x800 pixel .png image (I'm doing this because I'm having difficulty with using WRITE_PNG to output plots with labels in Times New Roman without the words looking pixelated).
>
> To do this I've tried defining a window in IDL and then using cpgs_config to record the necessary window information before passing it to cgps_open, as described on David Fanning's page: http://www.idlcoyote.com/ps_tips/ps_aspect.php, like so:
>
> WINDOW, XSize=1000, YSize=800
> dat_window = cgps_config()
> cgPS_Open, FILENAME='Test_ps.ps', TT_FONT = 'Times', CHARSIZE = 2.0,_REF_EXTRA = dat_window
>
> However, the program fails at the last line, outputting an error message: "Keyword FONT_SIZE not allowed in call to: CGPS_CONFIG". Is there any way to not have this variable outputted by cgps_config? Alternatively, is there any other way of creating a PostScript file that will convert to a 1000x800 pixel PNG file? I'd be grateful for any advice anyone could give me.

fontSize = !P.Charsize
!P.Charsize=2.0
cgPS_Open, 'test.png', TT_FONT='Times'
cgDisplay, 1000, 800
... graphics commands go here.
cgClose, WIDTH=1000
!P.Charsize=fontSize

You may well have to have the lastest version of the Coyote Library.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: Trouble using Coyote Graphics library to write PostScript file - keywords from cgps_config aren't accepted by cgps_open [message #87827 is a reply to message #87826] Thu, 27 February 2014 10:47 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> cgClose, WIDTH=1000

Whoops,

cgPS_Close, WIDTH=100

Of course. :-)

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: Trouble using Coyote Graphics library to write PostScript file - keywords from cgps_config aren't accepted by cgps_open [message #87844 is a reply to message #87827] Thu, 27 February 2014 15:45 Go to previous message
Jasdeep Anand is currently offline  Jasdeep Anand
Messages: 16
Registered: August 2011
Junior Member
David,

This worked fine once I downloaded the latest version of the CG library. Thanks!

On Thursday, 27 February 2014 18:47:26 UTC, David Fanning wrote:
> David Fanning writes:
>
>
>
>> cgClose, WIDTH=1000
>
>
>
> Whoops,
>
>
>
> cgPS_Close, WIDTH=100
>
>
>
> Of course. :-)
>
>
>
> David
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Remote X server
Next Topic: IDL Mac users - whats the difference between launching from the dock icon and launching from an x-window?

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

Current Time: Wed Oct 08 13:31:24 PDT 2025

Total time taken to generate the page: 0.00399 seconds