[Scilab-users] Circular contour plot

Jens Simon Strom j.s.strom at hslmg.de
Sat Apr 30 20:23:58 CEST 2016


Thanks Samuel!
Perfect workaround: -%inf instead of %nan to get the circle.
--------------------------------------------------------------------------------------------------------------------------------------
Am 30.04.2016 16:58, schrieb Samuel Gougeon:
> Le 29/04/2016 15:35, Jens Simon Strom a écrit :
>> Hallo Rafael,
>> your script is perfect, mine isn't. Where is the bug?
> in contourd2di() called by contour2d().
>
> As a workaround, you may use:
> R=1.;  //Radius Erde
> a=50;//Abstand Mond - Erde
> g0=1;  //Schwerebeschleunigung des Mondes im Zentrum der Erde
> VLev=[-0.02:0.002:0.02];  //Werte der Äquipotenziallinien-Kandidaten
> n=400;//Anzahl der x- und y-Werte
>
> clf
> f  =  gcf();
> f.color_map  =  zeros(100,3);  //Colormap
>
> an  =  linspace(0,2*%pi,400);
> x  =  a+R*sin(an);
> y  =  R*cos(an);
> plot(x,y,"-w")
> ca=gca();
> ca.isoview="on";
> p  =  ca.children(1).children;
> p.thickness=4;
> p.data(:,3)  =  0.1;
>
> x=linspace(a-R,a+R,n);    
> y=linspace(-R,R,n);  //Erdgebiet
> [X,Y]=ndgrid(x,y);
> V=-g0*(X+a^2../sqrt(X.^2+Y.^2)-2*a);
> pos=((X-a).^2+Y.^2  >  R^2);
> V(pos)  =  -%inf;
> xset("fpf","  ")  //Keine Levelanzeige, Reaktion erst nach dem 2. Lauf
> philev=contour2d(x,y,V,  VLev)//Plot und dargestellte Äquipotenziallinien
>
> ... and report the bug.
>
> Samuel
>
>
>
> _______________________________________________
> 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/20160430/db71285b/attachment.htm>


More information about the users mailing list