Re: contour map plot

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 13 Oct 2008 09:33:21 -0600 (MDT)


You need to include some additional information in your script
about where to overlay the contours on the map. You have to
be careful with this, because you need to make sure that
you have the correct lat/lon information for your data.

Since you stated in a previous email that you just have the lat/lon
end point information, then one way to communicate this to the map is
via these resources:

res.sfXCStartV = -131.3
res.sfXCEndV = -82.8
res.sfYCStartV = 19.8
res.sfYCEndV = 55.6

Setting these resources in this fashion makes the assumption that your
contour data is to be overlaid in the exact same space that you set up
your map for. I'm not sure this is correct for your data, however.

If you happen to have a set of arrays that define the lat/lon locations
of your data, then it's better to use this information, and then
instead of the above resources, you would set:

res.sfXArray = lon_array
res.sfYArray = lat_array

For one such example that uses sfXArray/sfYArray, see "" at:

There are others as well. You can go to:

and see a complete list of which examples reference which resources.
Search on "sfX", and you will see a list (same for "sfY").


On Fri, 10 Oct 2008, Terra Thompson wrote:

> Hi,
> I'm trying to use pyNgl to make a contour plot over a map with a polar
> stereographic projection. I saw an old post about this:
> However I have not been able to get it to work. My contours (heights) should
> show a trough over the continental US.
> I know the the contours themselves are correct but where they are plotted and
> their orientation is incorrect. I have tried setting start and end values
> (sfXCStartV) by guessing at the lat/lons and I can make the contour plot in
> generally the right area, but they are still incorrect. My python code and
> data file are attached.
> The old fortran and ncar graphics commands (below) create the same plot
> correctly.
> parameter (ngx=22,ngy=28)
> dimension work(ngx,ngy)
> ...
> call supmap(1,90.,0.0,-110.,55.6,-131.3,19.8,82.8,2,10,1,0,ierr)
> call conrec(work,ngy,ngy,ngx,0.0,0.0,60,-1,0,0)
> Do you have any suggestions?
> Thank you,
> ~Terra Thompson
pyngl-talk mailing list
Received on Mon Oct 13 2008 - 09:33:21 MDT

This archive was generated by hypermail 2.2.0 : Wed Oct 22 2008 - 13:49:33 MDT