[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Non-linear axis
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
--------------------------------------------------------------------------