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

Federico Miyara fmiyara at fceia.unr.edu.ar
Sun Mar 24 23:44:04 CET 2019


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20190324/9b31c459/attachment.htm>


More information about the users mailing list