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

Home » Public Forums » archive » Re: Labelling the axes on a log plot
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Labelling the axes on a log plot [message #60715] Sun, 08 June 2008 10:19 Go to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
>> So i want to label a log axis for example with these values -> 1. 0.1
>> 0.01 0.001 etc however what i get is 1.000 0.100 0.010 my problem is
>> the zeros after the value after the decimal point. What is the format
> Another option (but not what you wanted) is logticks_exp from this
> post:
>
> http://groups.google.com/group/comp.lang.idl-pvwave/browse_f rm/thread...

Here's an equivalent function, based heavily on Paul's code, that
should do what you want:

FUNCTION croppedtickmarks, axis, index, value
; number of decimal digits:
ndecdig = ceil(-(alog10(value))) > 0
; string version
ndigitstr = string(ndecdig, format='(I0)')
; reformat value with the desired number of decimal places. use
integers for 0
if ndecdig eq 0 then tickmark = string(value, format='(I0)') $
else tickmark = string(value, format='(F0.'+ndigitstr+')')
return, tickmark
END

-Jeremy.
[Message index]
 
Read Message
Read Message
Previous Topic: combining color tables
Next Topic: Re: vertical line that moves with cursor in draw widget

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

Current Time: Sat Oct 11 08:04:50 PDT 2025

Total time taken to generate the page: 1.43920 seconds