Re: object reference for strings using gsn_scm_contour_xxx

From: SR Nelson, School Geographical Sciences <S.R.Nelson_at_nyahnyahspammersnyahnyah>
Date: Thu, 11 Dec 2008 19:37:29 +0000

Hi Adam,

My understanding, from Example 9, was that this method should be avoided
where possible due to resources being reloaded and slowing things down.
HOwever, I don't have too many resources set so it shouldn't an issue.

I just assumed that there would be a way to change the gsnRightString
resource in the same way the title is changed in Example 9.

Sorry for the confusion and thanks for all the help, much appreciated.

Regards,
Sarah

--On 11 December 2008 12:16 -0700 Adam Phillips <asphilli_at_cgd.ucar.edu>
wrote:

> Hi Sarah,
>
> Perhaps I am not seeing why you are doing this, but couldn't you just do
> this:
>
> res1_at_gsnDraw = True
> res1_at_gsnFrame = True
>
> month = (/"Jan","Feb","Mar","Apr","May","Jun",\
> "Jul","Aug","Sep","Oct","Nov","Dec"/)
> nmonth = 12
> do imonth = 0,nmonth-1
> res1_at_gsnRightString = month(imonth)
> plot1 = gsn_csm_contour_map(xwks,tmp(imonth,:,:),res1)
> end do
> Adam
>
> SR Nelson, School Geographical Sciences wrote:
>> Hi Adam, yes I'm trying to change it after the plot has been drawn for
>> subsequent images. Here's the relevant bits of code:
>>
>>
>> month = (/"Jan","Feb","Mar","Apr","May","Jun",\
>> "Jul","Aug","Sep","Oct","Nov","Dec"/)
>>
>> imonth = 0
>> res1_at_gsnRightString = month(imonth) ; Month
>> plot1 = gsn_csm_contour_map(xwks,tmp(imonth,:,:),res1) ; Draw plot.
>>
>>
>> nmonth = 12
>> do imonth = 1,nmonth-1
>>
>> delete(res1_at_gsnRightString)
>> res1_at_gsnRightString = month(imonth)
>>
>> setvalues plot1_at_data
>> "sfDataArray" : tmp(imonth,:,:) ; Updata data to be plotted
>> end setvalues
>>
>> draw(plot1) ; Draw the contour plot
>> frame(xwks) ; Advance the frame
>>
>> end do
>>
>>
>> Hope that makes sense.
>> Thanks,
>> Sarah
>>
>>
>> --On 11 December 2008 11:56 -0700 Adam Phillips <asphilli_at_cgd.ucar.edu>
>> wrote:
>>
>>> Hi Sarah,
>>> Can you send the group a code snippet of your plotting section? I am not
>>> quite clear what you are trying to do.. Are you trying to alter the
>>> value of gsnRightString after the plot is drawn?
>>> Thanks,
>>> Adam
>>>
>>> SR Nelson, School Geographical Sciences wrote:
>>>> Hi all,
>>>>
>>>>
>>>> I'd like to use the gsn_csm_contour_xxx routines to generate an
>>>> animation of monthly data. I'm currently using the gsnRightString
>>>> resource to set the first month, and want to change using 'setvalues',
>>>> but I can't work out what object reference needed is. Please could
>>>> someone tell me where I can find this information (I've tried the
>>>> webpages, but not found anything).
>>>>
>>>>
>>>> Thanks in advance,
>>>> Sarah
>>>>
>>>>
>>>> ----------------------
>>>> Sarah Nelson
>>>> School Geographical Sciences
>>>> University of Bristol
>>>> University Road
>>>> Bristol BS8 1SS
>>>> Tel: 0117 3317316
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>> --
>>> --------------------------------------------------------------
>>> Adam Phillips asphilli_at_ucar.edu
>>> National Center for Atmospheric Research tel: (303) 497-1726
>>> ESSL/CGD/CAS fax: (303) 497-1333
>>> P.O. Box 3000
>>> Boulder, CO 80307-3000 http://www.cgd.ucar.edu/cas/asphilli
>>
>>
>>
>> ----------------------
>> Sarah Nelson
>> School Geographical Sciences
>> University of Bristol
>> University Road
>> Bristol BS8 1SS
>> Tel: 0117 3317316
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> --
> --------------------------------------------------------------
> Adam Phillips asphilli_at_ucar.edu
> National Center for Atmospheric Research tel: (303) 497-1726
> ESSL/CGD/CAS fax: (303) 497-1333
> P.O. Box 3000
> Boulder, CO 80307-3000 http://www.cgd.ucar.edu/cas/asphilli

----------------------
Sarah Nelson
School Geographical Sciences
University of Bristol
University Road
Bristol BS8 1SS
Tel: 0117 3317316
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Dec 11 2008 - 12:37:29 MST

This archive was generated by hypermail 2.2.0 : Wed Dec 24 2008 - 09:38:50 MST