# Re: log-depth-axis contour plot

```Hi Patrick,

Here is a more general technique that gives you full control over all
details of the axis labelling. I believe that it will work on Z axes, as
well.

- steve

===========================

! suppose you have some data on a grid x=1:100:1, y=1:100:1
define axis/x=1:100:1 xax
define axis/y=1:100:1 yax
let/title="test data" a = LOG(x[gx=xax]/8)+y[gy=yax]/100    ! some made up
data

! plot untransformed data
contour a

! define a new axis with the LOG transform of the X coordinates
define axis/from/name=xlog/x LOG(x[gx=xax])

! plot quick and dirty LOG-transformed data  in the upper plot
! NOTE: X axis labels will be LOG values rather than exponents
set window/new
set view upper
contour a[gx=xlog@asn]

! *** here's how to do a nicely labelled plot ***
set view lower

! base plot with large tics, only, unlabelled
ppl axlabp 0
contour/xlimits=0:2:1/title=" " a[gx=xlog@asn]

repeat/j=1:2:1 (repeat/i=1:10:1 ppl aline 1,`LOG(i)+j-1`,0,`LOG(i)+j-1`,-4)

! label the major tics with powers of 10
repeat/j=1:3:1 label `j-1`,-18,0,0,.1 "@SR10^`j-1`"

! label 2,3,5 of the minor tics
repeat/j=1:2:1 label `LOG(2)+j-1`,-15,0,0,.08 "@SR2"
repeat/j=1:2:1 label `LOG(3)+j-1`,-15,0,0,.08 "@SR3"
repeat/j=1:2:1 label `LOG(5)+j-1`,-15,0,0,.08 "@SR5"

============================

Patrick Joeckel wrote:

> Dear Ferret Users,
>
> On Fri, 19 Feb 1999 13:38:47 +0100 (MET)
> Rodrigo Caballero Augi gave the following example to do log-log contour
> plots and achieve a proper log-axis, i.e.
> 'the contours rescaled to the log axes *and* the "ppl axtype 2,2"-style
> tic marks - that is, with the ticks unevenly spaced'.
>
> However, if I try this with a /DEPTH-defined axis,
> ferret exits with this messages :
> YLO,YHI                                   on DEC-Alpha (Version 5)
>
> STOP: YLO,YHI
> Warning: Floating underflow occurred      on a Linux-PC (Version 5)
>
> Does anybody have a solution ?
>
> Thank you for your help !
>
> Sincerely,
>
>                Patrick Joeckel
>
> here is the above cited suggestion for non /DEPTH-defined axes:
> !!!!!!
>  ! suppose you have some data on a grid x=1:100:1, y=1:100:1
>  define axis/x=1:100:1 xax
>  define axis/y=1:100:1 yax
>  define grid/x=xax/y=yax gg
>  set grid gg
>  let a = LOG(x/10)+y/100    ! some made up data
>
>  ! plot untransformed data in the upper plot
>  set view upper
>  ppl axtype 1,1
>  contour a
>
>  ! define a new axis with the LOG transform of the X coordinates
>  define axis/from/name=xlog/x LOG(x)
>
>  ! plot LOG-transformed data in the lower plot
>  set view lower
>  ppl axtype 2,1
>  contour a[gx=xlog@asn]*0
>  ppl axtype 1,1
>  contour/over/pen=1/nolab a[gx=xlog@asn]
> !!!! end of example
>
> ---------------------------------------------------------------
> Patrick Joeckel
> Max Planck Institute for Chemistry
> Joh.-J. Becher Weg 27
> 55128 Mainz                   phone:++49-6131-305452
> Germany                       fax  :++49-6131-305436
>                              e-mail:joeckel@mpch-mainz.mpg.de
>                          http://www.mpch-mainz.mpg.de/~joeckel
> ---------------------------------------------------------------

--
Steve Hankin
NOAA/PMEL, 7600 Sand Point Way NE, Seattle, WA 98115-0070
ph. (206) 526-6080 -- FAX (206) 526-6744

```