11.28 Sample ‘contf

Function contf draw filled contours. You can select automatic (default) or manual levels for contours.

MGL code:

call 'prepare2d'
list v -0.5 -0.15 0 0.15 0.5
new a1 30 40 3 '0.6*sin(2*pi*x+pi*(z+1)/2)*sin(3*pi*y+pi*z) + 0.4*cos(3*pi*(x*y)+pi*(z+1)^2/2)'
subplot 2 2 0:title 'ContF plot (default)':rotate 50 60:box:contf a
subplot 2 2 1:title 'manual levels':rotate 50 60:box:contf v a
subplot 2 2 2:title '"\_" style':rotate 50 60:box:contf a '_'
subplot 2 2 3:title 'several slices':rotate 50 60:box:contf a1

C++ code:

void smgl_contf3(mglGraph *gr)
{
	mglData c;	mgls_prepare3d(&c);
	if(big!=3)	gr->Title("ContF3 sample");
	gr->Rotate(50,60);	gr->Light(true);	gr->Box();
	gr->ContF3(c,"x");	gr->ContF3(c);		gr->ContF3(c,"z");
	gr->Cont3(c,"kx");	gr->Cont3(c,"k");	gr->Cont3(c,"kz");
}

Sample contf