manpagez: man pages & more
info mathgl
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.1.24 Ring chart sample

../png/ring_chart

C++ code

mglData ch(7,2);
ch.Modify("rnd+0.1");
gr->Rotate(40,60);
gr->Light(true);
gr->SetFunc("(y+2)/3*cos(pi*x)","(y+2)/3*sin(pi*x)");
gr->Box();
gr->Chart(ch,"bgr cmy#");

MGL code

new ch 7 2
modify ch 'rnd+0.1'
rotate 40 60
light on
axis '(y+2)/3*cos(pi*x)' '(y+2)/3*sin(pi*x)' ''
box
chart ch 'bgr cmy#'

Pure C code

HMDT ch = mgl_create_data_size(7,2,1);
mgl_data_modify(ch,"rnd+0.1",0);
mgl_rotate(gr,40.,60.,0.);
mgl_set_light(gr,1);
mgl_set_func(gr,"(y+2)/3*cos(pi*x)","(y+2)/3*sin(pi*x)",0);
mgl_box(gr,1);
mgl_chart(gr,ch,"bgr cmy#");
mgl_delete_data(ch);

Fortran code

integer ch, mgl_create_data_size
ch = mgl_create_data_size(7,2,1)
call mgl_data_modify(ch,'rnd+0.1',0)
call mgl_rotate(gr,40.,60.,0.)
call mgl_set_light(gr,1)
call mgl_set_func(gr,'(y+2)/3*cos(pi*x)','(y+2)/3*sin(pi*x)','');
call mgl_box(gr,1)
call mgl_chart(gr,ch,'bgr cmy#')
call mgl_delete_data(ch)

Python

ch = mglData(7,2);  ch.Modify("rnd+0.1");
gr.Rotate(40,60);   gr.Light(True);
gr.SetFunc("(y+2)/3*cos(pi*x)","(y+2)/3*sin(pi*x)");
gr.Box();
gr.Chart(ch,"bgr cmy#");

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.