11.52 Sample ‘error2

Example of error kinds.

MGL code:

new x0 10 'rnd':new ex 10 '0.1'
new y0 10 'rnd':new ey 10 '0.1'
ranges 0 1 0 1
subplot 4 3 0 '':box:error x0 y0 ex ey '#+@'
subplot 4 3 1 '':box:error x0 y0 ex ey '#x@'
subplot 4 3 2 '':box:error x0 y0 ex ey '#s@'; alpha 0.5
subplot 4 3 3 '':box:error x0 y0 ex ey 's@'
subplot 4 3 4 '':box:error x0 y0 ex ey 'd@'
subplot 4 3 5 '':box:error x0 y0 ex ey '#d@'; alpha 0.5
subplot 4 3 6 '':box:error x0 y0 ex ey '+@'
subplot 4 3 7 '':box:error x0 y0 ex ey 'x@'
subplot 4 3 8 '':box:error x0 y0 ex ey 'o@'
subplot 4 3 9 '':box:error x0 y0 ex ey '#o@'; alpha 0.5
subplot 4 3 10 '':box:error x0 y0 ex ey '#.@'
subplot 4 3 11 '':box:error x0 y0 ex ey; alpha 0.5

C++ code:

void smgl_error2(mglGraph *gr)
{
	mglData x0(10), y0(10), ex(10), ey(10);
	for(int i=0;i<10;i++)
	{	x0.a[i] = mgl_rnd();	y0.a[i] = mgl_rnd();	ey.a[i] = ex.a[i] = 0.1;	}
	gr->SetRanges(0,1,0,1);	gr->Alpha(true);
	gr->SubPlot(4,3,0,"");	gr->Box();	gr->Error(x0,y0,ex,ey,"#+@");
	gr->SubPlot(4,3,1,"");	gr->Box();	gr->Error(x0,y0,ex,ey,"#x@");
	gr->SubPlot(4,3,2,"");	gr->Box();	gr->Error(x0,y0,ex,ey,"#s@","alpha 0.5");
	gr->SubPlot(4,3,3,"");	gr->Box();	gr->Error(x0,y0,ex,ey,"s@");
	gr->SubPlot(4,3,4,"");	gr->Box();	gr->Error(x0,y0,ex,ey,"d@");
	gr->SubPlot(4,3,5,"");	gr->Box();	gr->Error(x0,y0,ex,ey,"#d@","alpha 0.5");
	gr->SubPlot(4,3,6,"");	gr->Box();	gr->Error(x0,y0,ex,ey,"+@");
	gr->SubPlot(4,3,7,"");	gr->Box();	gr->Error(x0,y0,ex,ey,"x@");
	gr->SubPlot(4,3,8,"");	gr->Box();	gr->Error(x0,y0,ex,ey,"o@");
	gr->SubPlot(4,3,9,"");	gr->Box();	gr->Error(x0,y0,ex,ey,"#o@","alpha 0.5");
	gr->SubPlot(4,3,10,"");	gr->Box();	gr->Error(x0,y0,ex,ey,"#.@");
	gr->SubPlot(4,3,11,"");	gr->Box();	gr->Error(x0,y0,ex,ey);
}

Sample error2