[Scilab-users] more polarplots in one coordinate system

Samuel Gougeon sgougeon at free.fr
Mon Nov 28 15:01:17 CET 2016


Hello

Le 28/11/2016 11:12, Maxi041291 a écrit :
> Hello together,
>
> i would like two plot a few polarplots in one coordinate-system. The number
> of the plots should be defined by the length of a vector.
> In Matlab i would use the hold on command in a for Loop for it.
>
> I know, that i dont Need the hold on command in the plot(), but if i define
> two polarplots, i get two different coordinate Systems.
> For e.g.
> polarplot(Phase,magnitude)
> polarplot(Phase1, magnitude1)
>
> I have to define those in one polarplot to get one coordinate System for
> both:
> polarplot([Phase phase1],[Magnitude,magnitude1]).
>
> Now my question is:
>
> how can i automatically define more polarplots (depending on the length of
> my vectors) in one coordinate System?

If i understand well: you have several curves having different numbers 
of points, and you want to plot all of them on the same polarplot?
The only way i see presently to do that is
* to get the size of the longest vector
* to padd all other ones with %nan values
* finally to send the matrix of all concatenated vectors -- one column 
per curve

Example:

longest  =  100;   // maximal number of points
nc  =  2;          // number of curves
theta  =  zeros(longest,  nc)  +  %nan;
r  =  theta;

// Curve #1
i  =  1;
tmp  =  0:75;
theta(1:length(tmp),i)  =  tmp;
r(1:length(tmp),i)  =  sind(2*tmp);

// Curve #2
i  =  2;
tmp  =  45:135;
theta(1:length(tmp),i)  =  tmp;
r(1:length(tmp),i)  =  cosd(5*tmp);

// Display
polarplot(theta/180*%pi,  r)



HTH
Samuel Gougeon

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20161128/3129276b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eeajbced.png
Type: image/png
Size: 8776 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20161128/3129276b/attachment.png>


More information about the users mailing list