[Scilab-users] Stacked 2D plot in 3D

Claus Futtrup cfuttrup at gmail.com
Sat Feb 3 18:35:59 CET 2018


Hi Rafael

I've tried to make this code work for me, but ... (code):

// START OF CODE
frequencies = [201 811 3183 12862 25113]; // Hz;
angles = [0 30 60 90]; // deg
m_norm = [ 1.0   0.9945629   0.9643959   0.8756431;
           1.0   0.9914442   1.0244046   0.9414654;
           1.0   0.9910279   0.9670986   0.8932413;
           1.0   0.9339808   0.8378147   0.7067978;
           1.0   0.8985782   0.7536068   0.5074218];
[nf na] = size(m_norm)
A = (angles .*. ones(nf,1))';
F = (frequencies .*. ones(na,1));
M = 20*log10(m_norm'); // dB scale
clf();
sp = gca();
param3d1(F,A,M,alpha=50,theta=-110,flag=[2,4]);
e = gce();
for i=1:nf;
    e.children(i).foreground = color('dark blue');
    e.children(i).thickness = 2;
end
xgrid;
sp.log_flags = "lnn"; // x-axis log scale (frequencies)
sp.cube_scaling = "on";
xlabel("Frequency (Hz)");
ylabel("Angle (deg)");
zlabel("Mag (dB)");
// END OF CODE

The above code draws lines in the Y-axis direction. What I intended to do
is to draw lines in the frequency-direction (x-axis direction). I see how
e.children(i) manipulates the curves, but have failed to find a way to
change this (= the direction of the lines). I looked also at the examle
that Samuel gave with the plot3d3, where he draws a globe and can turn
lines on/off in the two directions ... I also looked at the latest proposal
by Samuel to updated param3d(1) and the lines in his last examples are
drawn along the x-axis direction.

Is the only solution to plot angle on x-axis and frequencies on y-axis?
(the rotate the cube differently) ...

(it's weird how one can stare at this for days without really understanding
what goes on)

Best regards,
Claus

On Sun, Jan 28, 2018 at 4:39 PM, Rafael Guerra <jrafaelbguerra at hotmail.com>
wrote:

> Claus,
>
> You can also try param3d1, which needs to be called only once:
>
> // START OF CODE
> frequencies = [201 811 3183 12862 25113]; // Hz;
> angles = [0 30 60 90]; // deg
> m_norm = [ 1.0   0.9945629   0.9643959   0.8756431;
>            1.0   0.9914442   1.0244046   0.9414654;
>            1.0   0.9910279   0.9670986   0.8932413;
>            1.0   0.9339808   0.8378147   0.7067978;
>            1.0   0.8985782   0.7536068   0.5074218];
> [nf na] = size(m_norm)
> A = (angles .*. ones(nf,1))';
> F = (frequencies .*. ones(na,1));
> M = 20*log10(m_norm'); // dB scale
> clf();
> sp = gca();
> param3d1(F,A,M,alpha=50,theta=-110,flag=[2,4]);
> e = gce();
> for i=1:nf;
>     e.children(i).foreground = color('dark blue');
>     e.children(i).thickness = 2;
> end
> xgrid;
> sp.log_flags = "lnn"; // x-axis log scale (frequencies)
> sp.cube_scaling = "on";
> xlabel("Frequency (Hz)");
> ylabel("Angle (deg)");
> zlabel("Mag (dB)");
> // END OF CODE
>
> Regards,
> Rafael
> _______________________________________________
> 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/20180203/13d3e2d6/attachment.htm>


More information about the users mailing list