# Re: y-axis log plot "Log axis requires all positive extent"

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Mar 18 2011 - 13:45:19 MDT

Hi Andrew,

Your question got posted to "ncl-talk-owner@ucar.edu". I'm including ncl-talk@ucar.edu here.

I admit I've never understood why the trYLog = True doesn't work for contour plots. Dave might have some information here.

res@gsnYAxisIrregular2Log = True
The way I found this resource was to go to the "tips" link off the Applications page, and then start searching on the word " log".
I had to add the space in front of "log", because otherwise I got a bunch of "climatology" hits.

I found these two examples, which both mention the same resource.

Making an axis logarithmic in a contour plot
axes_2.ncl (axes)
conwomap_5.ncl (contours w/o maps)

Hopefully this will help for future searches of information.

--Mary

On Mar 18, 2011, at 10:46 AM, Andrew Penny wrote:

> Hi all,
>
> I'm attempting to create a color-filled contour plot with the y-axis in log coordinates, however,
> nothing I try seems to work. I keep getting the error:
>
> warning:ContourPlotSetValues: Log axis requires all positive extent: setting trYAxisType to LinearAxis (trYLog to False)
>
> It looks as though this issue has been raised before, but none of the examples have
> proven helpful. None of my coordinate arrays are equal to or less than zero. Can anyone
> spot what I am missing? I've pasted a little dummy script below that illustrates the problem.
>
> Andy
>
> ;================================================
>
> ; CREATE DUMMARY DATA ARRAY "T"
> N = 10
> T = new((/N,N/),float)
> do i = 0, N - 1
> do j = 0, N - 1
> T(j,i) = (j-N/2)*(i-N/2)
> end do
> end do
>
> wks = gsn_open_wks ("pdf", "test_log" )
> gsn_define_colormap(wks,"rainbow")
>
> ; CREATE COORDINATE ARRAYS (> 0)
> x = ispan(N,2*N-1,1)
> y = ispan(N,2*N-1,1)
>
> T!0 = "vert"
> T&vert = y
> T!1 = "horiz"
> T&horiz = x
>
> cnres = True
> cnres@trYLog = True
> cnres@cnFillOn = True