Re: Scientific Notation on Log Plots [message #5793 is a reply to message #5711] |
Thu, 08 February 1996 00:00   |
zawodny
Messages: 121 Registered: August 1992
|
Senior Member |
|
|
In article <1996Feb7.204257.12075@pinet.aip.org> boswell@pinet.aip.org (jonathan_boswell) writes:
> zawodny@arbd0.larc.nasa.gov (Joseph M Zawodny) writes:
> : Try using some variant of this function with YTICKFORMAT. I use this to
> : get "even" powers of ten, but you can hack it to give 2.3*10^3 or whatever.
>
> [snip]
>
> Thanks Joe. Your routine is very clever. However did you figure out what
> parameters to give it?
>
> For those of you who don't know about it, the YTICKFORMAT keyword can take
> not only a format specifier, such as "(F9.0)", but also a function name.
> Apparently IDL then calls the function repeatedly when labelling the axis.
You do not need to give it any parameters, IDL sees the string stored in
the YTICKFORMAT keyword and calls that function with the proper parameters
automatically for each and every tickmark it is going to label on that axis.
When you write your function, you have to use the proper parameter list
that is defined in the IDL manuals somewhere. Just copy mine - it works!
In order to make my LOGTICK function work for fractional powers of ten
you will have to recreate the mantissa from the decimal portion of the
log10 of the tick value.
logval = log10(tickvalue)
exponent = strtrim(fix(logval),2)
mantissa = strtrim(string(10.^(logval mod 1.),form='(f3.2)'),2)
newtick = mantissa+'*10!u'+exponent+'!n'
I know the variables I use here are not the same ones as in the function
I posted earlier, but you can figure it out for yourself.
Have fun,
--
Dr. Joseph M. Zawodny KO4LW NASA Langley Research Center
E-mail: J.M.Zawodny@LaRC.NASA.gov MS-475, Hampton VA, 23681-0001
|
|
|