Re: Multiple plot file name versus single resource file name

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu, 20 Apr 2006 09:16:38 -0600

I believe you can accomplish this by using the PDF workstation
resource, wkPDFFileName. Below is a short example. You have to be sure
to delete the workstation before you open the next one up again,
because this effectively closes the workstation.


load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"

   y = (/0.,0.71,1.,0.7,0.002,-0.71,-1.,-0.71,-0.003/)

   pdf_filenames = (/"one.pdf","two.pdf","three.pdf","four.pdf"/)
   type = "pdf"

   do i=0,dimsizes(pdf_filenames)-1
     x = (i+1.)*5. + ispan(1,9,1)

     type_at_wkPDFFileName = pdf_filenames(i)
     wks = gsn_open_wks(type,"test") ; Use the same "test.res"
resource file for each PDF file.

     plot = gsn_csm_xy(wks,x,y,False) ; Draw an XY plot with 1
   end do

On Apr 20, 2006, at 3:55 AM, Gary J Robinson wrote:

> I am trying to create a set of PDF files that use the same resources.
> If I use the gsn_open_wks function then I can either specify the
> output file name(s) in the second argument OR specify the single
> resource file - resulting in the output file having to be renamed. The
> latter is not an option as I have multiple jobs running the same
> script, which could cause filename conflicts. I therefore use the
> first option and rely on the resources to be picked up from the
> hluresfile. Unfortunately, as I am invoking the ncl script from within
> a wrapper C program (via the system() function), this doesn't always
> work for some strange reason. Has anyone got any suggestions?
> Dr Gary J Robinson
> Using NCL 4.2.0.a033 on Linux, Solaris 10 and Mac OS X 10.4.6
> _______________________________________________
> ncl-talk mailing list

ncl-talk mailing list
Received on Thu Apr 20 2006 - 09:16:38 MDT

This archive was generated by hypermail 2.2.0 : Thu Apr 20 2006 - 09:30:39 MDT