[Scilab-users] Polarplot help

Claus Futtrup cfuttrup at gmail.com
Sat Jan 20 17:05:47 CET 2018


Hi Philippe

Thank you for the pointer. It works. To everybodys amusement, here comes a
script (with data reduced from more than 13000 to 21, so it can be posted
here). The reason is I have a new problem. Plotting in this case 3 set of
data, polarplot seems to auto_scale and turning it off doesn't work (??).
Please see this one:

// Test datafrequencies = [200 2000 20000]; // Hzangles = [0 30 60 90
120 150 180]; // degrees - convert to radians!mag00 = [69.253448
92.163385 87.414209]; // on-axis freq-responsemag30 = [68.461357
90.569082 76.073549];mag60 = [65.842262 90.745621 74.152067];mag90 =
[59.420658 80.893365 55.975304];mag120 = [52.505173 80.795915
44.363582];mag150 = [53.829987 59.793715 42.443964];mag180 =
[55.650341 73.457973 55.608187];magnitudes = [mag00' mag30' mag60'
mag90' mag120' mag150' mag180']; // 3 freq x 7 angles = 21 data
points, put into a matrix.// In the complete dataset there's 183
frequencies and 72 angles.
negative_angles = -angles(2:7);neg_angle_magnitudes = magnitudes(:,2:7);
angles = [angles negative_angles];magnitudes = [magnitudes
neg_angle_magnitudes];
[angles idx] = gsort(angles,'g','i');magnitudes = magnitudes(:,idx);
// Polar plot example:
    polplt = scf();
    p = gca(); // p = "polarplot" ... how ingenious :-/
    polarplot(%pi*angles/180,magnitudes(1,:));
    p.auto_scale = "off";
    polarplot(%pi*angles/180,magnitudes(2,:)); // index 2 = 2 kHz
    polarplot(%pi*angles/180,magnitudes(3,:));
    legend("200 Hz","2 kHz","20 kHz");
    p = gca(); // p = "polarplot" ... how ingenious :-/
    idx=find(p.children.type=="Text");
    p.children(idx).visible="off";


My "problem" is I cannot just specify polarplot to plot all three curves in
one go. So I execute one at the time, but now see the axis changes for each
of them (in the same figure)...

I hope it makes sense what I'm trying to do and my problem is
understandable.

Best regards,
Claus

On Sat, Jan 20, 2018 at 4:21 PM, philippe <rouxph.22 at gmail.com> wrote:

> Hi,
>
> Le 20/01/2018 à 11:08, Claus Futtrup a écrit :
> >
> >
> > How can I rotate the labels of the polarplot so that zero is up the
> > y-axis instead of out the x-axis? Alternatively, how can I disable the
> > labels?
>
> look at the Axis handle, the labels of a polar plot are additional
> children  of "Text" . Try this example :
>
>
> clf
> t = 0:0.01:2*%pi;
> polarplot(t, -1 + sin(t));
> A=gca()  // get the axis handle
> A.children//  look at all its children
> //The labels are those of "Text" type
> id=find(A.children.type="Text" )// get their id
> //then modify the properties of the handles
> A.children(id).visible="off" // no labels
> A.children(id).visible="on" // all labels
> A.children(id).text="mylabel" // change labels
> for k=id
>     A.children(k).text=string(k);
> end
>
>
> Philippe
>
> _______________________________________________
> 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/20180120/6b909bea/attachment.htm>


More information about the users mailing list