Re: attributes and resources

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Wed, 12 Jul 2006 12:31:54 -0600

Hi Diane,

You can set up your resources first, then use attsetvalues to apply the
user resources. The user resources would then override your settings.
For instance:
plot = create "plot" logLinPlotClass wks
       "trYMinF" : min(y)-2
       "trYMaxF" : max(y)+2
       "trXMinF" : min(xAxis)
       "trXMaxF" : max(xAxis)
       "pmTitleDisplayMode": "Always" ; allow titles
       "tiMainOn" : True
       "tiMainString" : ""
end create
if (plotres) then
    attsetvalues(plot,userres) ;if user resources are present, use them
end if

http://www.ncl.ucar.edu/Document/Functions/Built-in/attsetvalues.shtml

Good luck,
Adam

Diane Strassberg wrote:
> Hello
>
> I am currently modifying the wind rose function and when it is done
> other people will be using it. So, I want to have the attributes I have
> set to be the defaults and allow the user to change them as he or she
> likes. I know this can be done through assigning resources for the
> original function which the user calls and then using
> if(isatt(res,"attribute")... and then changing things from there.
>
> Can someone think of an easier way to do this since if I did this for
> each possible attribute things could get very long very fast and I would
> probably leave something out?
>
> Thanks
> Diane
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> 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
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jul 12 2006 - 12:31:54 MDT

This archive was generated by hypermail 2.2.0 : Thu Jul 13 2006 - 10:04:06 MDT