Re: Controlling x and y ranges for gsn_contour

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu, 22 May 2008 08:47:32 -0600 (MDT)

Hi Sean,

If I understand you correctly, I think you need to set:

   res_at_sfXArray = x
   res_at_sfYArray = y

This tells NCL what values define your X and Y axes. Otherwise, it
will just use index values that go from 0 to n-1, where n is the
number of points in the Z array in the X or Y direction.

Here's a small example using your same X,Y values.

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"

begin
   wks = gsn_open_wks("x11","test")

   x = (/2,4,6,2,4,6/)
   y = (/5,5,5,7,7,7/)
   z = (/1,2,3,2,1,3/)

   res = True
   res_at_sfXArray = x
   res_at_sfYArray = y

   plot = gsn_contour(wks,z,res)
end

--Mary

On Thu, 22 May 2008, Crowell, Sean M. wrote:

> I'm using gsn_contour to make contour plots, and the file is reading in my x and y arrays properly (checked using print) and interpolating properly using natgrids, but when I make the contour plots, it only plots the x and y values up to the smallest dimension (length of x or y) and leaves out the rest of the array with more distinct values.
>
> To clear it up a bit:
>
> I've got a data file that looks like
> 2 5 z
> 4 5 z
> 6 5 z
> 2 7 z
> 4 7 z
> 6 7 z
>
> And when it does the contour plot, the x's only range up to 4, which I'm assuming is some default option to make the plot square. How do I control this?
>
> Sean Crowell
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu May 22 2008 - 08:47:32 MDT

This archive was generated by hypermail 2.2.0 : Fri May 23 2008 - 09:39:48 MDT