Dear Scilabers This weekend I'm trying to do some polar plots and experiment with GUI. What I'm trying to do is quite similar to Example 3 in the help: I work with loudspeakers and in our industry it's standard to have the zero degree angle up the yaxis (as in above Example 3). How can I rotate the labels of the polarplot so that zero is up the yaxis instead of out the xaxis? Alternatively, how can I disable the labels? Best regards, Claus _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users 
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 > yaxis instead of out the xaxis? 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 [hidden email] http://lists.scilab.org/mailman/listinfo/users 
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 data frequencies = [200 2000 20000]; // Hz angles = [0 30 60 90 120 150 180]; // degrees  convert to radians! mag00 = [69.253448 92.163385 87.414209]; // onaxis freqresponse mag30 = [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 <[hidden email]> wrote: Hi, _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users 
In reply to this post by Claus Futtrup
Hi Claus, For the angles orientation problem in polar plot and correct labelling, here below a simple solution: // START OF CODE clf t = 0:0.01:2*%pi; t90 = %pi/2  t; //redefine angleconvention consistent with loudspeaker plots theta = t; // keep Scilab angles for theta rho = 1 + sin(t90); // use new angle mapping for rho polarplot(theta, rho); a=gca(); set(a,'rotation_angles',[180,0]); // rotate plot axes // END OF CODE Regards, Rafael _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users 
In reply to this post by Claus Futtrup
Hi Claus, Regarding your problem of not being able to plot all curves in one go preserving the scales, if I am not mistaken
this can be solved by invoking polarplot with a single call using array notation. See example here below with 2 curves for simplicity:
// START
OF CODE
clf
t
=
0:0.01:2*%pi;
t90
=
%pi/2

t;
//redefine angleconvention consistent with loudspeaker plots
theta
=
t;
// keep Scilab angles for theta
rho1
=
1 +
sin(t90).^2;
// use new angle mapping for rho1
rho2
=
1 +
2*cos(t90).^2;
// use new angle mapping for rho2
polarplot([theta,theta],
[rho1,rho2]);
a=gca();
set(a,'rotation_angles',[180,0]);
// rotate plot axes
// END OF
CODE Regards, Rafael _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users 
In reply to this post by Rafael Guerra
Hi Rafael Thank you. It works. Interesting how the 'set' command alone can do the trick: set(a,'rotation_angles',[180,0]); Excellent. :) Best regards, Claus On Sun, Jan 21, 2018 at 12:55 PM, Rafael Guerra <[hidden email]> wrote:
_______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users 
In reply to this post by Rafael Guerra
Hi Rafael Array notation. After Reading your suggestion I looked at the documentation of polarplot and this is not explicitly treated, so I missed that one. Thank you. Best regards, Claus On Sun, Jan 21, 2018 at 1:08 PM, Rafael Guerra <[hidden email]> wrote:
_______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users 
Hi Rafael, et al. I now see that  actually  example 2 of the documentation indeed does plot two graphs. There's no explanation to the example ... sometimes the documentation for Scilab functions is incredibly hard to read for someone who doesn't already know in advance. /Claus On Sun, Jan 21, 2018 at 1:41 PM, Claus Futtrup <[hidden email]> wrote:
_______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users 
Samuel GOUGEON 
In reply to this post by Claus Futtrup
Hello Clauss,
After a first polarplot upgrade in 2010, i started writting some other improvements in 2016, first about still improving angular and radial labels positionning. Yesterday, i took the opportunity of your message to post on the CodeReview the polarplot.sci in progress, and to go on a bit, mainly about proper labels for polar datatips. You can already use the scripts as is: https://codereview.scilab.org/#/c/19684/ Just click on the polarplot.sci link, and then you may download it, or copy/past the content. The trick with gca().rotation_angles reminded y Rafael is well known, but due to labels uncentered on their anchor, using it currently shifts labels (see the screenshot below). This is fixed in the CodeReview version. If you want to be fully backcompatible with this new polarplot.sci, you should simply comment lines performing some glue(). This won't prevent other improvements working. Other improvements can be proposed, as listed in the review header:
This may be seen as a "preSEP" :). A proper SEP will be
required. To come.
So, the final implementation won't use this trick. Later, with a priority clearly lower, the same job shall be done for graypolarplot(). Cheers _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users 
Claus Futtrup 
Hi Samuel It looks like excellent work. I checked my polar plot and the labels are indeed a little bit off (mostly visible with 3digit numbers, i.e. 120, 150, 180 and so on degrees). It works OK for now. I think your upgraded polarplot should go into the main tree  the plots as seen on the picture you included looks excellent. If overplotting could be fixed, that would also be very nice. P.S. it reminds me that Scilab 6 was released about a year ago. Normally such a first release with such big changes will require some bug fixing, but surprisingly this seems not to be the case. Impressive how well 6.0.0 was executed (and it also took a couple of years ...). I could not execute my latest script (with the polar and contour plots) in Scilab 5  it ran out of memory. I wonder if anyone can say what's up in regard to Scilab releases? Best regards, Claus On Sun, Jan 21, 2018 at 9:41 PM, Samuel Gougeon <[hidden email]> wrote:
_______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users 
Free forum by Nabble  Resume Templates  Edit this page 