11.43 Sample ‘dens3

Function dens3 draw ordinary density plots but at slices of 3D data.

MGL code:

call 'prepare3d'
title 'Dens3 sample':rotate 50 60:alpha on:alphadef 0.7
origin 0 0 0:box:axis '_xyz'
dens3 c 'x':dens3 c ':y':dens3 c 'z'

C++ code:

void smgl_dens3(mglGraph *gr)
{
	mglData c;	mgls_prepare3d(&c);
	if(big!=3)	gr->Title("Dens3 sample");
	gr->Rotate(50,60);	gr->Alpha(true);	gr->SetAlphaDef(0.7);
	gr->SetOrigin(0,0,0);	gr->Axis("_xyz");	gr->Box();
	gr->Dens3(c,"x");	gr->Dens3(c);	gr->Dens3(c,"z");
}
Sample dens3