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

Home » Public Forums » archive » Re: how to create a LOG array from A to B
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: how to create a LOG array from A to B [message #78995 is a reply to message #78994] Thu, 12 January 2012 13:50 Go to previous messageGo to previous message
manodeep@gmail.com is currently offline  manodeep@gmail.com
Messages: 33
Registered: June 2006
Member
On Jan 12, 3:41 pm, nata <bernat.puigdomen...@gmail.com> wrote:
> Michael,
>
> Your code works but this is not exactly what I need.
> Using your method I get something like this :
>
>   a=1.5
>   b=5.45
>   N=20
>   elev=ALOG10(FINDGEN(N) * (10.^b - 10.^a) / (N - 1.) + 10.^a)
>   PLOT, elev, REPLICATE(1,N), YR=[0,2], XR=[a,b], /XLOG, /XS, /YS,
> PSYM=7
>
> And I would like to have all the points equal-spaced on the plot. Do
> you think this is possible ?
> Thank you for your help,
>
> nata

Hi Nata,

As long as A and B are > 0, you can use this:

log_limits = alog10([A,B])
log_binsize = (log_limits[1]-log_limits[0])/(N-1.0)
log_values = findgen(N)*log_binsize + log_limits[0]

values = 10.0d^log_values

HTH,
Manodeep
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: WIDGET_BASE: Unable to connect to X Windows display: :0.0
Next Topic: Re: Multiple parameters for ZEROFCN

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

Current Time: Thu Oct 09 19:58:12 PDT 2025

Total time taken to generate the page: 0.47509 seconds