Re: Log Y-axis on contour plot.

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed Oct 21 2009 - 21:05:14 MDT

See

http://www.ncl.ucar.edu/Document/Graphics/Resources/gsn.shtml#gsnYAxisIrregular2Log

Some Examples:

Axes
http://www.ncl.ucar.edu/Applications/axes.shtml#ex2

Contours wo maps
http://www.ncl.ucar.edu/Applications/conwomap.shtml#ex6

Zonal Average
http://www.ncl.ucar.edu/Applications/zonal.shtml#ex6

Good luck

Gareth Berry wrote:
> Hi Folks,
>
> Stupid question, but this is driving me up the wall!
>
> I have a simple 2d data set, pressure x time and I want to plot a
> contour plot with the log of pressure on the Y-axis. My pressure
> coordinates are irregularly spaced but range from 100-975hPa.
>
> Seems simple, but when using gsn_csm_contour with no resources set for
> the y-axis NCL complains that "irregular coordinate array sfYArray
> non-monotonic: defaulting sfYArray" . With gsnYAxisIrregular2Log =
> True I get: "LogAxis requires all positive data extent: defaulting
> trYAxisType to LinearAxis" although the coordinate axis values are all
>> 0 (100-975hPa). Perhaps I'm doing something truely boneheaded, but
> infuriatingly I can do logarithmic xy plots of the same dataset at the
> individual points! I've tried boiling it down to its most basic, but
> still nothing works!
>
> I'm using V5.1.1 on mac osx, if that is relevant. Below is the simple
> script I've been working with and the (tiny) dataset is attached.
>
> -----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>
> begin
>
> infile = addfile("mofo.nc","r")
>
> data = infile->data
>
> printVarSummary(data)
>
> wks = gsn_open_wks( "x11", "test" )
>
> res = True
>
> ;res@gsnYAxisIrregular2Linear = True
> ;res@sfYArray = data&level
> res@gsnYAxisIrregular2Log = True
>
>
> plot=gsn_csm_contour(wks,data,res)
>
> end
>
> -----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Any guidance is appreciated!
>
> Cheers,
>
> Gareth.
>
>
> P.S. I've also tried gsn_csm_pres_hgt, but get even more baffling
> errors, perhaps someone clever understands if there is a link to my
> problems above...
>
> fatal:ftcurv: Error number 2.
> fatal:Execute: Error occurred at or near line 2157 in file
> $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl
>
> fatal:Execute: Error occurred at or near line 11289 in file
> $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Oct 21 21:05:13 2009

This archive was generated by hypermail 2.1.8 : Fri Oct 23 2009 - 11:36:30 MDT