Re: IDL: plots in semi- or log-log [message #8486 is a reply to message #8362] |
Tue, 11 March 1997 00:00  |
James Tappin
Messages: 54 Registered: December 1995
|
Member |
|
|
Tony Adriaansen wrote:
>
> In article <331AC300.41C6@obs-nice.fr>,
> Frederic Paletou <paletou@obs-nice.fr> wrote:
>> Hi there,
>>
>> I'm wondering if there's a simple way to avoid getting
>> a 10^0 tickmark when using a log-axis with PLOT.
>>
>> Cheers,
[SIG.SNIP]
>
> Hi Frederic,
> There's a real simple way IF 10^0 is your FIRST tickmark:
>
> plot_oi,x,y,xtickname='1'
>
> This replaces the first tickmark label only, IDL/PVWAVE
> puts in the others.
>
> Where 10^0 is NOT the first ticklabel, make a string array containing
> the real labels:
>
[SIG.SNIP]
Or more elegantly define a tick format function e.g.
FUNCTION ltformat, iax, index, val
jpow = round(alog10(val))
if (jpow eq 0) then return, '1' $
else return, string(jpow, format="('10!u',i0,'!n')")
end
then do (e.g.)
plot, x,y, xtickformat='ltformat', /xlog
--
+------------------------+---------------------------------- --+---------+
| James Tappin, | School of Physics & Space Research | O__ |
| sjt@star.sr.bham.ac.uk | University of Birmingham | -- \/` |
| Ph: 0121-414-6462. Fax: 0121-414-3722 | |
+----------------------------------------------------------- --+---------+
|
|
|