# Re: Non-linear axis

• Subject: Re: Non-linear axis
• From: Martin Schultz <martin.schultz(at)dkrz.de>
• Date: Tue, 24 Oct 2000 16:35:24 +0200
• Newsgroups: comp.lang.idl-pvwave
• Organization: Max-Planck-Institut fuer Meteorologie, Hamburg
• References: <39F576DB.A4798249@uni-essen.de>
• Xref: news.doit.wisc.edu comp.lang.idl-pvwave:21854

```Irene Dumkow wrote:
>
> I am trying to add axis to an image. This part works (using a contour
> plot
> for the axis and matching the image size and plot window). My problem
> is that I would like to have one of the y-axis with a non-linear
> scaling,
> in this particular case it is basically y1*y1. I tried something with
> reading in the tickvalues, calculating the new values and than using
> YTICKNAMES, but IDL still does the y-scale linearly. Any hints,
> pointers, etc would be more
> than welcome.
>
> Irene Dumkow

Funny coincidence. Just this morning I had someone in my office asking
that you would need to interpolate your image somehow to bring it onto
a regular "grid". Something along the following lines could do the
trick. This is opnly a starting point, but hopefully it puts you on
the right track.

data=dist(7,7)
xnew = 10.^((findgen(7)>1.e-3))    ;; here, you would do sqrt instead
xnew = ((xnew-min(xnew))/(max(xnew)-min(xnew)))*7
id=interpolate(data,xnew,findgen(7),/grid)
contour,id,lev=findgen(10)*0.3,c_col=indgen(30)*2+3

Cheers,
Martin

--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
[[ Dr. Martin Schultz   Max-Planck-Institut fuer Meteorologie    [[
[[                      Bundesstr. 55, 20146 Hamburg             [[
[[                      phone: +49 40 41173-308                  [[
[[                      fax:   +49 40 41173-298                  [[
[[ martin.schultz@dkrz.de                                        [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[

```