[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.1.17 Mark sample
C++ code
mglData y(50,3), y1(50); y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2); y1.Modify("0.5+0.3*cos(2*pi*x)"); gr->Box(); gr->Mark(y,y1,"bs");
MGL code
new y 50 3 modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)' modify y 'sin(2*pi*x)' 1 modify y 'cos(2*pi*x)' 2 new y1 50 modify y1 '0.5+0.3*cos(2*pi*x)' box mark y y1 'bs'
Pure C code
HMDT y = mgl_create_data_size(50,3,1); HMDT y1 = mgl_create_data_size(50,1,1); mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); mgl_data_modify(y,"sin(2*pi*x)",1); mgl_data_modify(y,"cos(2*pi*x)",2); mgl_data_modify(y1,"0.5+0.3*cos(2*pi*x)",0); mgl_box(gr,1); mgl_mark_y(gr,y,y1,"bs"); mgl_delete_data(y); mgl_delete_data(y1);
Fortran code
integer y, y1, mgl_create_data_size y = mgl_create_data_size(50,3,1) y1 = mgl_create_data_size(50,1,1) call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0) call mgl_data_modify(y,'sin(2*pi*x)',1) call mgl_data_modify(y,'cos(2*pi*x)',2) call mgl_data_modify(y1,'0.5+0.3*cos(2*pi*x)',0) call mgl_box(gr,1) call mgl_mark_y(gr,y,y1,'bs') call mgl_delete_data(y) call mgl_delete_data(y1)
Python
y, y1 = mglData(50,3), mglData(50); y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0); y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2); y1.Modify("0.5+0.3*cos(2*pi*x)"); gr.Box(); gr.Mark(y,y1,"bs");