Re: Can getvalues reference tickmark resources

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Mon Jun 16 2014 - 18:50:54 MDT

Hi Jonathan,

Probably what is going on is that the tickmarks are created by a sub-object
of the plot object you created. If you print the plot object
you will see its sub-objects.
For example, if you draw a contour over a map using gsn_csm_contour_map,
e.g.:
   plot = gsn_csm_contour_map(wks, data, res)

and then print plot, you will see something like the following:

Variable: plot
Type: obj
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
Number Of Attributes: 3
  tickmarks : tickmarks tickMarkClass 52
  data : gsn_csm_contour_map_data scalarFieldClass 9
  contour : gsn_csm_contour_map_contour contourPlotClass 11
(0) map mapPlotClass 37

so in this case, you can figure that the tick maks are drawn by the
tickmarks object. To retrieve the labels and values, do:

  getvalues plot@tickmarks
        "tmYLLabels" : labels
        "tmYLValues" : values
  end getvalues
  print (labels + " " + values)

giving output like this:
(0) 90S -90
(1) 60S -60
(2) 30S -30
(3) 0 0
(4) 30N 30
(5) 60N 60
(6) 90N 90

Hope this helps.
 -dave










On Mon, Jun 16, 2014 at 3:51 PM, jonathan meyer <tallj03@hotmail.com> wrote:

> Thanks Rick, that helps tremendously and will certainly help down the road.
>
> When I try to access the tmYLLabels resource using getvalues, I get the
> following error:
>
> warning:tmYLLabels is not a valid resource in map at this time
> warning:NhlGetValues:Error retrieving tmYLLabels
>
> While I'm not explicitly setting this resource myself, the plot does
> contains labels. Is there another resource that is responsible for creating
> these labels besides tmYLLabels?
>
> When I've used getvalues for contouring, I've been able to access the
> specific contour resources that I was not explicitly defining in my
> resources list.
>
> Jon
>
> ------------------------------
> Date: Mon, 16 Jun 2014 11:40:16 -0600
> Subject: Re: Can getvalues reference tickmark resources
> From: brownrig@ucar.edu
> To: tallj03@hotmail.com
> CC: ncl-talk@ucar.edu
>
> Hi Jon,
>
> If you look at the resources for tickmarks at:
>
> http://ncl.ucar.edu/Document/Graphics/Resources/tm.shtml
>
> at the top it says "TickMark (tm) Resources". The word "TickMark" is a
> link taking you to:
>
> http://ncl.ucar.edu/Document/HLUs/Classes/TickMark.shtml
>
> which lists all the tickmark resources (for example, and similarly for
> other resource types). In each row, there are a set of letter codes, such
> as "RCSG". These codes stand for:
>
> R - ?
> C - create
> S - set
> G - get
>
> so the one's with G are ones you should be able to query with getvalues.
>
> Hope that helps...
>
> Rick
>
>
>
> On Mon, Jun 16, 2014 at 11:24 AM, jonathan meyer <tallj03@hotmail.com>
> wrote:
>
> Hi NCL group,
>
> I am hoping to use the getvalues statement to reference a maps tickmark
> resources for use on a subsequent plot.
>
> I have used getvalues for contour resources before but can not find an
> example or documentation on which resources can be accessed with this
> statement.
>
> Ideally, I'd like to gather the tmYL resources used to create the nice
> longitude labels/tickmark locations on a map which would then be given to
> an X-Y plot with the same Y dimensions, but no lat/lon attributes.
>
> If there is a place besides the quick NCL statement guide that describes
> what can be accessed by the getvalues statement, feel free to direct me
> there.
>
> Thanks in advance.
> Jon
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

Received on Tue Jun 17 12:51:01 2014

This archive was generated by hypermail 2.1.8 : Wed Jul 23 2014 - 15:33:46 MDT