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

Home » Public Forums » archive » Re: formatting yticks over orders of mag.
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: formatting yticks over orders of mag. [message #20013] Fri, 12 May 2000 00:00
Craig Markwardt is currently offline  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 #20014 is a reply to message #20013] Fri, 12 May 2000 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Paul van Delst (pvandelst@ncep.noaa.gov) writes:

> Well, I tried the most simple-minded thing and bugger me if it didn't
> work. Cool.

Ooohhh. There are days when I l-o-v-e IDL! :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: formatting yticks over orders of mag. [message #20017 is a reply to message #20013] Fri, 12 May 2000 00:00 Go to previous message
Paul van Delst is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Max memory on IRIX?
Next Topic: formatting yticks over orders of mag.

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

Current Time: Wed Oct 08 19:15:39 PDT 2025

Total time taken to generate the page: 0.00648 seconds