[Scilab-users] A question about plotting

Serge Steer Serge.Steer at inria.fr
Mon Aug 4 10:25:37 CEST 2014


Le 02/08/2014 09:59, Floyd Xu a écrit :
>
> Hi , All:
>
> I have a question about plotting.
>
> I want to plot 2 lines in a graphic , so I type the command as below:
>
> -->x=linspace(0,2*%pi,40);
>
> -->y1=sin(x)
>
> -->y2=cos(x);
>
> -->X=[x,x];
>
> -->Y=[y1,y2];
>
Generating X and Y creates row vectors. if you want to draw several 
curves with one plot instruction, each curve must be passed as a column 
of an array
-->X=[x;x]';
-->Y=[y1;y2]';
-->plot(X,Y)

or simpler
plot(x',Y)


Then , I type the plot command :
>
> -->plot(x,y1,x,y2);
>
> The result is shown as below:
>
> Graphic window number 0 (2).bmp
>
> But when I type a command as below:
>
> -->plot(X,Y);
>
> The result is :
>
> Graphic window number 0.bmp
>
> It  has an additional line.
>
> Why will this line appear?
>
> Thanks for your reply.
>
>
>
> 	
>
> Floyd Xu
> Electronic System Design Engineer | Driveline
> Office: +86 510 8528 5478  | Mobile: +86 137 7106 3561 | 
> Floyd.Xu at ka-group.com <mailto:Floyd.Xu at ka-group.com>
> Kongsberg Automotive | No 30 & 32 Xikun Road, Wuxi Singapore Ind. 
> Park | Wuxi | Jiangsu 214028 | CN
> Tel: +86 510 8528 2165 | www.kongsbergautomotive.com 
> <http://www.kongsbergautomotive.com>
> Enhancing the driving experience
>
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20140804/3980f4dd/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 13383 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20140804/3980f4dd/attachment.jpe>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 11917 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20140804/3980f4dd/attachment-0001.jpe>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 11637 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20140804/3980f4dd/attachment-0002.jpe>


More information about the users mailing list