Re: formatting yticks over orders of mag. [message #20013] |
Fri, 12 May 2000 00:00 |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
Paul van Delst <pvandelst@ncep.noaa.gov> writes:
> Hi,
>
> Is there a way in PLOT, /YLOG to format the yticks "dynamically". E.g.
> If my y-values range from 0.001 to 10000, can the ytick labels be forced
> to be
>
> 0.001, 0.01, 0.1, 1, 10, 100, 1000, 10000
>
> rather than
>
> 0.001, 0.010, 0.100, 1.000, 10.000, 100.000, 1000.000, 10000.000
>
> The latter requires me to change my XMARGIN keyword so that I can see
> the y-axis label to such an extent that there's not much plot area left
> (due to the 10000.000). I would rather not do the 10^n format since it
> doesn't give the same impression of magnitude change (plotology :o). I
> looked at the YICKFORMAT documentation but that seems to apply to *all*
> the ytick values. I am wrong about this?
Hi--
I usually do this by hand, namely with the YTICKNAME keyword.
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
|
Re: formatting yticks over orders of mag. [message #20017 is a reply to message #20013] |
Fri, 12 May 2000 00:00  |
Paul van Delst
Messages: 364 Registered: March 1997
|
Senior Member |
|
|
Paul van Delst wrote:
>
> Hi,
>
> Is there a way in PLOT, /YLOG to format the yticks "dynamically". E.g.
> If my y-values range from 0.001 to 10000, can the ytick labels be forced
> to be
>
> 0.001, 0.01, 0.1, 1, 10, 100, 1000, 10000
>
> rather than
>
> 0.001, 0.010, 0.100, 1.000, 10.000, 100.000, 1000.000, 10000.000
>
> The latter requires me to change my XMARGIN keyword so that I can see
> the y-axis label to such an extent that there's not much plot area left
> (due to the 10000.000). I would rather not do the 10^n format since it
> doesn't give the same impression of magnitude change (plotology :o). I
> looked at the YICKFORMAT documentation but that seems to apply to *all*
> the ytick values. I am wrong about this?
Well, I tried the most simple-minded thing and bugger me if it didn't
work. Cool.
I used the following with YTICKFORMAT='ylogticks' in the PLOT command:
FUNCTION ylogticks, axis, index, value
exponent = LONG( ALOG10( value ) )
CASE 1 OF
( exponent LT 0 ): format = '( f' + $
STRTRIM( ABS( exponent ) + 2, 2 ) + $
'.' + $
STRTRIM( ABS( exponent ), 2 ) + $
' )'
( exponent GE 0 ): format = '( i' + $
STRTRIM( ABS( exponent ) + 1, 2 ) + $
' )'
ENDCASE
RETURN, STRING( value, FORMAT = format )
END
and it worked just like I wanted.
Sorry for wasting peoples time,
paulv
--
Paul van Delst Ph: (301) 763-8000 x7274
CIMSS @ NOAA/NCEP Fax: (301) 763-8545
Rm.202, 5200 Auth Rd. Email: pvandelst@ncep.noaa.gov
Camp Springs MD 20746
|
|
|