# Re: [ferret_users] weird contour

```thank you, Ansley!!

```
Yes, I am trying to use these curvilinear grids. (sorry for calling them as irregular grids).
```
It looks like I need to make the xb grid be 2D instead of 1D.
I just tried to do this, with this script:

let xb=x[x=0:290:10]
let yb=y[y=0:290:10]
let yb1= if (yb1 GT -1) then 1 else 0
let xb2=xb*yb1 !this makes a 2D array with all the rows the same; is
!     there an easier way to do this??
let zb=I[x=0:290:10]*J[y=0:290:10]
contour/hlimits=-100:400:50 xb2+zb,xb2,zb

```
But even with both xb2 and zb being two-dimensional, I get the same problems with contour. I will keep studying this problem. But can you advise further?
```
PM
---------------------------------------------
http://geosci.uchicago.edu/~mcguire/
---------------------------------------------
Department of the Geophysical Sciences
University of Chicago

On Thu, 17 Sep 2009, Ansley Manke wrote:

```
```hi Patrick -
```
What Ferret calls an irregular grid, is just an irregularly-spaced rectangular grid.
```
```
We have graphics commands for data on "Curvilinear grids" - http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/working-with-special-data-sets/CURVILINEAR-COORDINATE-DATA
```In that section is the definition:

A curvilinear grid has longitudes and latitudes defined by
coordinates (lon[i, j],lat[i, j]) in 2D, and the data fields are
also defined on the [i,j] index grid. ...

And the details of graphical commands for these grid types is at
http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/customizing-plots/MAP-PROJECTIONS-AND-CURVILINEAR-COORDINATES#_VPINDEXENTRY_876

Ansley

Patrick McGuire wrote:
```
```But can't the contour command use irregular grids?
zb is an example of an irregular grid.

PM
---------------------------------------------
http://geosci.uchicago.edu/~mcguire/
---------------------------------------------
Department of the Geophysical Sciences
University of Chicago

On Thu, 17 Sep 2009, Ansley Manke wrote:

```
```Hi Patrick,
```
I'm confused by your example. The variables zb and (xb+zb) are 2-dimensional arrays, 30x30, but xb is 1-d. The 3-argument contour command expects all arguments to be 2-D arrays.
```
Ansley

Patrick McGuire wrote:
```
```Hi Ferret Users
I've been having some problems with ferret recently.

```
The example below demonstrates the problem. I can give more examples if you wish. But this problem affects ALL of my FERRET plots for the methane-hydrate model spongebob, where I plot data from a netcdf file.
```
FERRET EXAMPLE:
let xb=x[x=0:290:10]
let zb=I[x=0:290:10]*J[y=0:290:10]
contour/hlimits=-100:400:50 xb+zb,xb,zb

```
The problem seems to be when I use an irregular zb grid, sometimes when I do contour or fill, the plot has really weird and large jumps in the x direction of the contours. We're using ferret 6.2.
```
```
Do you have any insights? I have attached a screenshot if you don't see the problem when you run these commands yourself. If you don't see it on your end, you might try changing the commands slightly to see if you can see similar problems. But this has been reproduced by other ferret 6.2 users.
```
PM
---------------------------------------------
http://geosci.uchicago.edu/~mcguire/
---------------------------------------------
Department of the Geophysical Sciences
University of Chicago

```
------------------------------------------------------------------------
```
```
```
```
```
```