Re: extracting plot limits after xy plotting

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue, 25 Jul 2006 22:44:33 -0600 (MDT)

>
> 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
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jul 25 2006 - 22:44:33 MDT

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