Re: extracting plot limits after xy plotting

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed, 26 Jul 2006 07:19:08 -0600 (MDT)

I fixed a minor typo in the following script.
I also added some comments about possible use
of "nice_mnmxintval"

On Tue, 25 Jul 2006, Dennis Shea wrote:

>>
>> If I create a plot with p=gsn_xy(...), and do not set the resource trXMinF,
>> is it possible to extract the plot's X axis limits from p?
>>
> yes ... use "getvalues" .... see the "getvalues" section of:
>
> http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclStatements.shtml
>
> Example .....
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> begin
> npts = 20
> x = fspan(22.4,61.3, npts)
> y = random_normal ( 10,5, npts)
>
> wks = gsn_open_wks("x11","xy_keith")
>
> res = True
> plot=gsn_xy(wks,x,y,res)
>
> getvalues plot ; Retrieve resource values from graphic object
> "trXMinF" : x_plot_min
> "trXMaxF" : x_plot_max
> "trYMinF" : y_plot_min
> "trYMaxF" : y_plot_max
> end getvalues
>
> print("x_plot_min="+x_plot_min)
> print("x_plot_max="+x_plot_max)
> print("y_plot_min="+y_plot_min)
> print("y_plot_max="+y_plot_max)
> end
> _______________________________________________

If you want a common set of trXMinF, trXMaxF, trYMinF, trYMaxF
for (say) a suite of x-y or contour plots [eg, paneling] then
"nice_mnmxintval" may be the approach to use:

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

Example 3 illustrates an x-y application.

HTH
D
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jul 26 2006 - 07:19:08 MDT

This archive was generated by hypermail 2.2.0 : Fri Jul 28 2006 - 16:18:18 MDT