[Scilab-users] subplot problem

Nikolay Strelkov n.strelkov at gmail.com
Mon Jan 19 10:22:45 CET 2015


Hello, rathodprashnt !

You need to move plot(x,y) to the end of for loop.

t=0:0.01:10;
x=cos(2*%pi*t); theta=0

for k=1:4
    y=cos(2*%pi*k*t);
    if k==1 then subplot(221)
    elseif k==2 then subplot(222)
    elseif k==3 then subplot(223)
    elseif k==4 then subplot(224)
    end
*    plot(x,y);*
end

[image: Встроенное изображение 1]

I recommend you to read/watch some tutorials on Scilab (
http://www.openeering.com/scilab_tutorials or
http://www.scilab.in/spoken-tutorial ).


With best regards,
maintainer of Mathieu functions toolbox for Scilab
<http://atoms.scilab.org/toolboxes/Mathieu>,
IEEE member, Ph.D.,
Nikolay Strelkov.


2015-01-17 13:16 GMT+03:00 rathodprashnt <rathodprashnt at gmail.com>:

> Hy  i am new to scilab and i am trying to run new with subplot command
> using
> (221) to (224) format but some how out of 4 subplot only last one is
> visible.
>
> here is my script
> _____________________
>
> t=0:0.01:10;
> x=cos(2*%pi*t); theta=0
>
> for k=1:4
>     y=cos(2*%pi*k*t);
>     if k==1 then subplot(221)
>     elseif k==2 then subplot(222)
>     elseif k==3 then subplot(223)
>     elseif k==4 then subplot(224)
>     end
> end
> plot(x,y);
> _________________________________
> <http://mailinglists.scilab.org/file/n4031642/Graphic_window_number_0.bmp>
>
>
> i have also attached image of graph.
>
>
> thank you
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/subplot-problem-tp4031642.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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20150119/3d683cb9/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 4subplots.png
Type: image/png
Size: 26657 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20150119/3d683cb9/attachment.png>


More information about the users mailing list