[Scilab-users] Plotting -- why wrong values on the x and y axes?

Radovan Omorjan omorr at uns.ac.rs
Wed Jul 9 07:30:55 CEST 2014


You used plot(y) instead of plot(t,y).
With plot(y), on the x-axis will be the appropriate index of the vector 
elements y.
As you did not give the third element in linspace(0,2*%pi) then the 
default number 100 will be used and t will be a vector with 100 elements 
as well as y with y=sin(t)

Regards,
Radovan

On 7/9/2014 7:12 AM, tanthiamhuat wrote:
> t=linspace(0,2*%pi);y=sin(t);plot(y)
>
> why do I get a plot with wrong x-y values?
>
> see output here..
> http://postimg.org/image/x7c75ucpz/
>
> isn't my x-values range should be from 0 to 2*pi (6.283185), and the maximum
> y-values to be 1, and minimum y-values to be -1?
>
> what went wrong?
>
>
>
> --
> View this message in context: http://mailinglists.scilab.org/Plotting-why-wrong-values-on-the-x-and-y-axes-tp4030855.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>


---
U ovoj e-pošti nema virusa i zlonamjernih programa jer je aktivna avast! antivirusna zaštita.
http://www.avast.com




More information about the users mailing list