vis_files/generate_plots.js
/// Draws posterior distributions for the parameters
Draws posterior distributions for the parameters
Draws posterior distributions for the parameters
function drawparamdist(vis)
{
	plottype = "graph";
	cv = resultcv; 
	cv.clearRect(0,0,graphdx,graphdy);
	cv.lineWidth = 2;
	var visli = vis.line[0];
	var xcol = visli.xcol;
	var ycol = visli.ycol;
	cv.beginPath(); 
	for(i = 0; i < xcol.length; i++){
		x = Math.floor(graphdx*(xcol[i]-axxmin)/(axxmax-axxmin));
		y = Math.floor(graphdy-graphdy*(ycol[i]-axymin)/(axymax-axymin));
		if(i == 0) cv.moveTo(x,y);
		else cv.lineTo(x,y);
	}	
	setstyle(visli.style);
	cv.stroke();
	cv.lineTo(x,graphdy);
	x = Math.floor(graphdx*(xcol[0]-axxmin)/(axxmax-axxmin));
	cv.lineTo(x,graphdy);
	cv.globalAlpha = 0.3;
	cv.fillStyle = "#22ff22";
	cv.fill();
	cv.globalAlpha = 1;
	if(vis.line.length > 1){
		var visli = vis.line[1];
		if(visli.true){
			cv.beginPath(); 
			x = Math.floor(graphdx*(visli.true-axxmin)/(axxmax-axxmin));
			cv.moveTo(x,0);
			cv.lineTo(x,graphdy);
			setstyle(vis.line[1].style);
			cv.stroke();
		}
	}	
	setdash(0);
}
function drawparamdist ( vis ) { plottype = "graph" ; cv = resultcv ; cv . clearRect ( 0 , 0 , graphdx , graphdy ) ; cv . lineWidth = 2 ; var visli = vis . line [ 0 ] ; var xcol = visli . xcol ; var ycol = visli . ycol ; cv . beginPath ( ) ; for ( i = 0 ; i < xcol . length ; i ++ ) { x = Math . floor ( graphdx * ( xcol [ i ] - axxmin ) / ( axxmax - axxmin ) ) ; y = Math . floor ( graphdy - graphdy * ( ycol [ i ] - axymin ) / ( axymax - axymin ) ) ; if ( i == 0 ) cv . moveTo ( x , y ) ; else cv . lineTo ( x , y ) ; } setstyle ( visli . style ) ; cv . stroke ( ) ; cv . lineTo ( x , graphdy ) ; x = Math . floor ( graphdx * ( xcol [ 0 ] - axxmin ) / ( axxmax - axxmin ) ) ; cv . lineTo ( x , graphdy ) ; cv . globalAlpha = 0.3 ; cv . fillStyle = "#22ff22" ; cv . fill ( ) ; cv . globalAlpha = 1 ; if ( vis . line . length > 1 ) { var visli = vis . line [ 1 ] ; if ( visli . true ) { cv . beginPath ( ) ; x = Math . floor ( graphdx * ( visli . true - axxmin ) / ( axxmax - axxmin ) ) ; cv . moveTo ( x , 0 ) ; cv . lineTo ( x , graphdy ) ; setstyle ( vis . line [ 1 ] . style ) ; cv . stroke ( ) ; } } setdash ( 0 ) ; }
Draws posterior distributions for the parameters
Draws posterior distributions for the parameters