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

Home » Public Forums » archive » Re: Trig plots auto-shifted (?)
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: Trig plots auto-shifted (?) [message #81016] Thu, 02 August 2012 20:29 Go to previous message
A J is currently offline  A J
Messages: 11
Registered: February 2012
Junior Member
On 3 Aug, 12:27, David Fanning <n...@idlcoyote.com> wrote:
> A J writes:
>> Anyone know why IDL plots trig functions of negative numbers as
>> shifted to the positive?
>
>> Example:
>
>> x = -1. * dindgen(100)
>> y = sin(x)
>> plot, y, xrange=[-100,100]
>
>> plots the correct sine function, but over the xrange of [0,100] even
>> though the input xvalues are all negative. I know I could shift it
>> back, but I want to know why it is doing this. Any thoughts?
>
> Because if you only plot the dependent data, it
> creates the independent data like this:
>
>    indep = Indgen(N_Elements(y))
>
> I think IDL has done that since the beginning of time. :-)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Yeah I figured that out jsut after I posted. Tried to remove the post,
but, damn, someone saw it first!
[Message index]
 
Read Message
Read Message
Previous Topic: Re: imcontour no longer plotting in color
Next Topic: max_value/min_value in the x-axis?

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

Current Time: Fri Oct 10 02:02:25 PDT 2025

Total time taken to generate the page: 1.27984 seconds