lines(0)/// set old_style on ; /// @@prerequisite affectations \sleftarrow{\normalfont switching to old style } ///\center{Parametric plot in \( \R\sp{3}\)} xbasc();t=linspace(-20*%pi,20*%pi,2000); /// \sleftarrow{\normalfont \verb+xbasc+\index{xbasc@\texttt{xbasc}} clears the current graphic window and recorded graphic statements } param3d1(sin(t),t.*cos(t)/maxi(t),t/100) /// \sleftarrow{\normalfont a \( \R\sp{3}\) curve }\index{param3d1@\texttt{param3d1}} xs2ps(0,'fig1'); /// @@prerequisite affectations xs2ps(0,'fig1'); /// \sleftarrow{\normalfont replay with a Postscript driver building a postscript file} /// \center{Plot a surface in \( \R\sp{3}\)} xbasc();x=linspace(-%pi,%pi,40); y=linspace(-%pi,%pi,40); plot3d(x,y,sinh(x')*cos(y)) ; /// \sleftarrow{\normalfont a \( \R\sp{3}\) surface }\index{plot3d@\texttt{plot3d}} xs2ps(0,'fig2'); /// @@prerequisite affectations /// \center{Plot a vector field in \( \R\sp{3}\)} xbasc() function [xdot]=derpol(t,x); xdot=[x(2);-x(1)+(1 - x(1)**2)*x(2)];endfunction xf= linspace(-1,1,10);yf= linspace(-1,1,10); fchamp(derpol,0,xf,yf); /// \sleftarrow{\normalfont an \( \R\sp{2}\) vector field } \index{fchamp@\texttt{fchamp}} xs2ps(0,'fig3'); /// @@prerequisite affectations /// \center{Plot an histogram } xbasc(); v=rand(1,2000,'n'); histplot([-6:0.4:6],v,[1],'015',' ',[-4,0,4,0.5],[2,2,2,1]);/// \sleftarrow{\normalfont histogram } \index{histplot@\texttt{histplot}} function [y]=f2(x); y=exp(-x.*x/2)/sqrt(2*%pi); endfunction; x=-6:0.1:6;x=x';plot2d(x,f2(x),1); /// \sleftarrow{\normalfont superposing a \( \R\sp{2}\) curve } xs2ps(0,'fig4');/// @@prerequisite affectations /// \center{Polar plot in \( \R\sp{2}\)} xbasc();polarplot();xs2ps(0,'fig5'); /// \sleftarrow{\normalfont an \( \R\sp{2}\) curve in polar mode }\index{polarplot@\texttt{polarplot}} /// \center{Plot a surface given by facets in \( \R\sp{3}\) } xbasc(); function [x,y,z]=f3(alp,tet) r=log(1+abs(alp)) x=cos(alp).*cos(tet); y=cos(alp).*sin(tet); z=sinh(alp); endfunction x=linspace(-%pi/2,%pi/2,40);y=linspace(0,2*%pi,20); [x1,y1,z1]=eval3dp(f3,x,y); /// \sleftarrow{\normalfont building a set of facets } \index{eval3dp@\texttt{eval3dp}} plot3d1(x1,y1,z1); /// \sleftarrow{\normalfont an \( \R\sp{3}\) surface composed by a set of facets} xs2ps(0,'fig6');/// @@prerequisite affectations /// \center{Graphic basic functions \texttt{xrects}} xbasc();plot2d([],[],rect=[0,0,1,1],strf="012"); /// \sleftarrow{\normalfont just to fix a current scale } xset('clipgrf'); /// \sleftarrow{\normalfont setting a clip zone in the graphic frame } n=20; rects=[0.8*rand(1,n);0.8*rand(1,n);0.2*ones(1,n);0.2*ones(1,n)]; xrects(rects,rand(1,n)*20); /// \sleftarrow{\normalfont a set of rectangles }\index{xrects@\texttt{xrects}} xs2ps(0,'fig8');/// @@prerequisite affectations ///\center{Graphic basic functions \texttt{xpolys}} xbasc() a=get("current_axes"); /// \sleftarrow{\normalfont get a handle on the newly created axes} a.axes_visible="off"; /// \sleftarrow{\normalfont makes the axes visible} a.data_bounds=[-2*cos(%pi/6),0;2*cos(%pi/6),3]; /// \sleftarrow{\normalfont set the boundary values for x and z } a.box="off"; theta=[-%pi/6,%pi/2,%pi*7/6,-%pi/6]; T=[cos(theta);sin(theta)]; Ts=(1/(1+2*sin(%pi/6)))*rotate(T,%pi); x=[T(1,:);Ts(1,:)]'; y=[T(2,:);Ts(2,:)]'; x=[x+cos(%pi/6),x-cos(%pi/6),x];y=[y+sin(%pi/6),y+sin(%pi/6),y+1+2*sin(%pi/6)]; a.thickness=8; /// \sleftarrow{\normalfont setting line thickness }\index{xset!thickness} xpolys(x,y); /// \sleftarrow{\normalfont a set of polyline }\index{xpolys@\texttt{xpolys}} xs2ps(0,'fig9');/// @@prerequisite affectations unix(SCI+'/bin/Blatexprs panorama fig[1-9]') /// @@prerequisite affectations /// \sleftarrow{\normalfont calling a Unix script} unix(SCI+'/bin/BEpsf fig1'); /// @@prerequisite affectations /// \sleftarrow{\normalfont calling a Unix script} unix(SCI+'/bin/BEpsf fig2'); /// @@prerequisite affectations /// \sleftarrow{\normalfont calling a Unix script} unix(SCI+'/bin/BEpsf fig3'); /// @@prerequisite affectations /// \sleftarrow{\normalfont calling a Unix script} unix(SCI+'/bin/BEpsf fig4'); /// @@prerequisite affectations /// \sleftarrow{\normalfont calling a Unix script} unix(SCI+'/bin/BEpsf fig5'); /// @@prerequisite affectations /// \sleftarrow{\normalfont calling a Unix script} unix(SCI+'/bin/BEpsf fig6'); /// @@prerequisite affectations /// \sleftarrow{\normalfont calling a Unix script} unix(SCI+'/bin/BEpsf fig8'); /// @@prerequisite affectations /// \sleftarrow{\normalfont calling a Unix script} unix(SCI+'/bin/BEpsf fig9');/// @@prerequisite affectations /// \sleftarrow{\normalfont calling a Unix script}