Re: [Scilab-users] cannot get polarplot to graph a decent windrose

2019-03-25 Thread Samuel Gougeon

Le 25/03/2019 à 12:17, Samuel Gougeon a écrit :


Le 24/03/2019 à 16:18, Heinz Nabielek a écrit :
.../...
__

Second problem:

plot several curves in polar mode is to use matrices as input, as for the 
plot() and plot2d() functions

does not work
x = (0:360)'/180*%pi;
z=[(0.5*(1 + cos(x)))  (0.5+(1 + cos(x)))];
polarplot(x,z);

produces the ERROR MESSAGE

at line18 of function polarplot ( 
/Applications/scilab-6.0.2.app/Contents/MacOS/share/scilab/modules/graphics/macros/polarplot.sci
 line 31 )
Inconsistent row/column dimensions.


To be reported. 


here: http://bugzilla.scilab.org/16019

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] cannot get polarplot to graph a decent windrose

2019-03-25 Thread Samuel Gougeon

Hello Heinz,

Le 24/03/2019 à 16:18, Heinz Nabielek a écrit :

First polarplot problem was to put 0 on top and 90° to the right. This problem 
was solved by Federico using gca().rotation_angles = [180 0]

x = (0:360)/180*%pi;
y = 0.5*(1 + cos(x));
polarplot(x, y)
gca().rotation_angles = [180 0]


Yes, this is the trick. It work since Scilab 6.0.2. Before, labels were 
shifted when rotating the axes. This was recently corrected in order to 
use this trick. It is now being documented 
.



__
Second problem:

plot several curves in polar mode is to use matrices as input, as for the 
plot() and plot2d() functions

does not work
x = (0:360)'/180*%pi;
z=[(0.5*(1 + cos(x)))  (0.5+(1 + cos(x)))];
polarplot(x,z);

produces the ERROR MESSAGE

at line18 of function polarplot ( 
/Applications/scilab-6.0.2.app/Contents/MacOS/share/scilab/modules/graphics/macros/polarplot.sci
 line 31 )
Inconsistent row/column dimensions.


To be reported. This occurs since the first ages of Scilab. This clearly 
deserves to be fixed.

The behavior should be the plot() and plot2d() one.

As a workaround before Scilab 6.1.0, the following code may be used:

x = (0:360)'/180*%pi;
z = [(0.5*(1 + cos(x)))  (0.5+(1 + cos(x)))];
polarplot(x*ones(z(1,:)), z)


Samuel

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] cannot get polarplot to graph a decent windrose

2019-03-24 Thread Federico Miyara


Heinz,

This example shows how to plot multiple graphs and rotate the plot:

// Generate angles
x = (0:360)/180*%pi;
// Generate two directional patterns
y = 0.5*(1 + cos(x));
z = 0.5 + 0.5*(1 + cos(x));
// Just in case clear figure
clf
// Plot both patterns
polarplot(kron(1:2,x'),[y' z'], [1 2])
// Rotate 90° the polar plot
gca().rotation_angles = [0 180];

The documentation for polarplot 
(https://help.scilab.org/docs/6.0.2/en_US/polarplot.html) seems to be 
incomplete, since the description indicates that rho and theta are 
vectors of the same size, but it does not mention, except tacitly in 
example 2, that they can be also matrices of equal size, whose 
homologous columns are theta-rho pairs. The third argument refers to 
line style, and usually is 1:n where n is the number of columns (graphs).


There is also a difference with plot, which allows that the first 
argument be either a single vector containing the x data for all the 
graphs, while the second argument may be a vector for a single graph or 
a matrix for several graphs sharing the same x data.


The rotation statement uses the figure handle properties. gca() refers 
to the current axes, and gca().rotation_angles refers to the rotation 
property, which by default is [0 270]. [0 180] rotates it so that 0° is 
on the top.


Finally, you can change the text in the peripheral scale, which by 
default indicates the angle values. For instance


gca().children([23, 5, 11, 17]).text = ["N" "E" "S" "W"];

changes the text properties of the children objects (these refer to the 
ticks and their labels) 23, 5, 11 and 17 from 0, 270, 180, 90 to the 
names of the cardinal directions.


I don't know how to change easily the number and separation of angular 
ticks to allow NNE, NE and so on.


Federico Miyara





On 23/03/2019 13:17, Heinz Nabielek wrote:
Please help: I just cannot get the Scilab "polarplot" to graph a 
similar windrose as EXCEL is doing. Mainly as far as the orientation 
is concerned

Heinz












---
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] cannot get polarplot to graph a decent windrose

2019-03-24 Thread Heinz Nabielek
First polarplot problem was to put 0 on top and 90° to the right. This problem 
was solved by Federico using gca().rotation_angles = [180 0]

x = (0:360)/180*%pi;
y = 0.5*(1 + cos(x));
polarplot(x, y)
gca().rotation_angles = [180 0]

__
Second problem:
> plot several curves in polar mode is to use matrices as input, as for the 
> plot() and plot2d() functions

does not work
x = (0:360)'/180*%pi;
z=[(0.5*(1 + cos(x)))  (0.5+(1 + cos(x)))]; 
polarplot(x,z);

produces the ERROR MESSAGE
> at line18 of function polarplot ( 
> /Applications/scilab-6.0.2.app/Contents/MacOS/share/scilab/modules/graphics/macros/polarplot.sci
>  line 31 )
> Inconsistent row/column dimensions.

_
Third: solving my problem with 

polarplot(x,z(:,1),style=1);polarplot(x',z(:,2),style=5);

gives me two polarplot curves, but messes up the diagram with twice writing out 
all angles and all function scales which I do not want.

And:
gca().children(2).visible = "off" 

does not help it either.

So, I am still stuck with problem #2 and problem #3 and help would be 
appreciated.
Heinz




> On 24.03.2019, at 13:31, Samuel Gougeon  wrote:
> 
> Hello,
> 
> Le 24/03/2019 à 03:27, Federico Miyara a écrit :
>> 
>> Heinz,
>> 
>>> gca().rotation_angles = [180 0] is perfect for me. 270° West is correctly 
>>> on the left hand side !
>>> 
>>> But I get a mess with a multiple plot.I want the degrees only at the 
>>> outermost circle
>>> Heinz
>>> 
>>> for i=1:6; ..
>>> polarplot(theta,MM(:,i),style=i); ...
>>> end;
>>> gca().rotation_angles = [180 0]
> 
> Where is the original message, and what's the original request and its 
> context?
> I have not received it and it is not archived for any Scilab mailing list.
> 
> It's not possible to use polarplot() in overplotting mode.
> 
> The only way to plot several curves in polar mode is to use matrices as 
> input, as for the plot() and plot2d() functions, and as illustrated in some 
> polarplot() examples.
> 
> Samuel

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] cannot get polarplot to graph a decent windrose

2019-03-24 Thread Samuel Gougeon

Hello,

Le 24/03/2019 à 03:27, Federico Miyara a écrit :


Heinz,

gca().rotation_angles = [180 0] is perfect for me. 270° West is 
correctly on the left hand side !


But I get a mess with a multiple plot.I want the degrees only at 
the outermost circle

Heinz

for i=1:6; ..
polarplot(theta,MM(:,i),style=i); ...
end;
gca().rotation_angles = [180 0]


Where is the original message, and what's the original request and its 
context?

I have not received it and it is not archived for any Scilab mailing list.

It's not possible to use polarplot() in overplotting mod 
e.


The only way to plot several curves in polar mode is to use matrices as 
input, as for the plot() and plot2d() functions, and as illustrated in 
some polarplot() examples.


Samuel

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] cannot get polarplot to graph a decent windrose

2019-03-23 Thread Federico Miyara


Heinz,

gca().rotation_angles = [180 0] is perfect for me. 270° West is 
correctly on the left hand side !


But I get a mess with a multiple plot.I want the degrees only at 
the outermost circle

Heinz

for i=1:6; ..
polarplot(theta,MM(:,i),style=i); ...
end;
gca().rotation_angles = [180 0]


Sorry, I don't know how to fix that elegantly... except a brute force 
method.


Try the following. Take as an example with two graphs:

clf
x  =  (0:360)/180*%pi;
y  =  0.5*(1  +  cos(x));
z  =  0.375  +  0.675*cos(x);
polarplot(x,z)
polarplot(x,y)


Then,

gca().children

yields

 ans  =

70 by 1 matrix of handles:
==
Text
Segs
Text
Segs

(...)

I pressume that there are 70 "children" (any subordinated object) whose 
handles are organized as a matrix (or rather a column vector...), so I 
retrieve their handles writing


gca().children(n)

where n is a number between 1 and 70. They should contain some 
interesting properties.


For instance:

gca().children(1)

yields

Handle of type "Text" with properties:
==
parent: Axes
children: []
visible = "on"
text = "330"
alignment = "left"

(...)

The "330" suggests this property is which controls at least one of both 
(in my case) 330's, so


gca().children(1).visible = "off"

should make it invisible... and it does!

Then you could create a loop varying n so to make them all disappear. As 
a previous task, check which graph reaches the maximum and draw it at 
the end, so that you remove all the degree marks up to the graph before 
the last one.


I'm sure there must be a better way to do this, but in the emergency it 
might do the job. If you find a better solution, please comment it.



Federico Miyara


On 23/03/2019 19:59, Heinz Nabielek wrote:
gca().rotation_angles = [180 0] is perfect for me. 270° West is 
correctly on the left hand side !


But I get a mess with a multiple plot.I want the degrees only at 
the outermost circle

Heinz

for i=1:6; ..
polarplot(theta,MM(:,i),style=i); ...
end;
gca().rotation_angles = [180 0]




---
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users