Re: Multiple plot file name versus single resource file name

From: Gary J Robinson <gazza_at_nyahnyahspammersnyahnyah>
Date: Thu, 20 Apr 2006 16:37:14 +0100

Mary,

Your idea works a treat!

I hadn't considered adding the PDF filename as an attribute to the
workstation type.

Thanks!

gary.

On 20 Apr 2006, at 16:16, Mary Haley wrote:

> 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.
>
> --Mary
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>
> begin
> 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 curve.
> delete(wks)
> end do
> end
>
> 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_at_ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
Received on Thu Apr 20 2006 - 09:37:14 MDT

This archive was generated by hypermail 2.2.0 : Mon Apr 24 2006 - 09:06:29 MDT