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 #81018 is a reply to message #81016] Thu, 02 August 2012 19:27 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
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.")
[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 15:48:42 PDT 2025

Total time taken to generate the page: 0.88096 seconds