[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.7.3 Semi-log sample

C++ code
mglData x(2000), y(2000); x.Modify("0.01/(x+10^(-5))"); y.Modify("sin(1/v)",x); gr->Axis(mglPoint(0.01,-1),mglPoint(1000,1),mglPoint(0.01,-1)); gr->SetFunc("lg(x)",0); gr->SetTicks('x',0); gr->Box(); gr->Plot(x,y,"b2"); gr->Axis(); gr->Grid("xy","g"); gr->Label('x',"x",0); gr->Label('y', "y = sin 1/x",0);
MGL code
new x 2000 new y 2000 modify x '0.01/(x+10^(-5))' modify y 'sin(1/v)' x xrange 0.01 1000 origin 0.01 -1 0 xtick 0 axis 'lg(x)' '' '' plot x y 'b2' axis grid 'xy' 'g' xlabel 'x' 0 ylabel 'y = sin 1/x' 0 box
Pure C code
HMDT x = mgl_create_data_size(2000,1,1); HMDT y = mgl_create_data_size(2000,1,1); mgl_data_modify(x,"0.01/(x+10^(-5))",0); mgl_data_modify_vw(y,"sin(1/v)",x,0); mgl_set_axis(gr,0.01,-1.,0.,1000.,1.,0.,0.01,-1.,0.); mgl_set_func(gr,"lg(x)",0,0); mgl_set_ticks(gr,0.,-5.,-5.); mgl_box(gr,1); mgl_plot_xy(gr,x,y,"b2"); mgl_axis(gr,"xy"); mgl_axis_grid(gr,"xy","g"); mgl_label_ext(gr,'x',"x",0,-1.4,0); mgl_label_ext(gr,'y', "y = sin 1/x",0,-1.4,0); mgl_delete_data(x); mgl_delete_data(y);
Fortran code
integer x,y, mgl_create_data_size x = mgl_create_data_size(2000,1,1) y = mgl_create_data_size(2000,1,1) call mgl_data_modify(x,'0.01/(x+10^(-5))',0) call mgl_data_modify_vw(y,'sin(1/v)',x,x) call mgl_set_axis(gr,0.01,-1.,0.,1000.,1.,0.,0.01,-1.,0.) call mgl_set_func(gr,'lg(x)','','') call mgl_set_ticks(gr,0.,-5.,-5.) call mgl_box(gr,1) call mgl_plot_xy(gr,x,y,'b2') call mgl_axis(gr,'xy') call mgl_axis_grid(gr,'xy','g') call mgl_label_ext(gr,'x','x',0.,-1.4,0.) call mgl_label_ext(gr,'y', 'y = sin 1/x',0.,-1.4,0.) call mgl_delete_data(x) call mgl_delete_data(y)
Python
TO BE DONE