comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Non-linear axis
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Non-linear axis [message #22077] Tue, 24 October 2000 00:00
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Irene Dumkow <irene.dumkow@uni-essen.de> writes:

> 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.

Pay no attention to Martin. :-) There is no need to resample your
data. Use the YTICKV and YTICKS keywords instead. The first gives
the positions of the ticks, and the second gives the number of ticks
(plus one?). For some reason you need both keywords. If you need to
label the ticks with non-default values then use YTICKNAMES as well.

Here's an example with a parabola:

IDL> x = findgen(10)
IDL> y = x*x
IDL> plot, x, y, ytickv=[0,1,4,9,16,25,36,49,64,81,100], yticks=10

Normally YTICKS must be at least n_elements(YTICKV).

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: Non-linear axis [message #22082 is a reply to message #22077] Tue, 24 October 2000 00:00 Go to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
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
a similar question. They wanted a log axis. All I know about this is
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 [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: filename check
Next Topic: Re: delvar v/s reset_session

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 04:23:16 PDT 2025

Total time taken to generate the page: 1.47735 seconds