vis_files/generate_plots.js
/// Draws a matrix giving the mixing between different age groups
Draws a matrix giving the mixing between different age groups
Draws a matrix giving the mixing between different age groups
function drawmatrix(vis)
{
	plottype = "matrix";
	cv = resultcv; 
	cv.clearRect(0,0,graphdx,graphdy);
	var nage = vis.ages.length;
	var d = graphdx/nage;
	for(i = 0; i < nage; i++){
		for(j = 0; j < nage; j++){
			var div = Math.floor(0.999999*col_map.div*(vis.ele[i][j]-col_map.min)/(col_map.max-col_map.min));
			pr(div+" "+vis.ele[i][j]+" "+col_map.min+" "+col_map.max+"k");
			var col = "rgb("+col_map.map[div].R+","+col_map.map[div].G+","+col_map.map[div].B+")";
			fillrect(i*d,j*d,d,d,col);     
		}
	}
}
function drawmatrix ( vis ) { plottype = "matrix" ; cv = resultcv ; cv . clearRect ( 0 , 0 , graphdx , graphdy ) ; var nage = vis . ages . length ; var d = graphdx / nage ; for ( i = 0 ; i < nage ; i ++ ) { for ( j = 0 ; j < nage ; j ++ ) { var div = Math . floor ( 0.999999 * col_map . div * ( vis . ele [ i ] [ j ] - col_map . min ) / ( col_map . max - col_map . min ) ) ; pr ( div + " " + vis . ele [ i ] [ j ] + " " + col_map . min + " " + col_map . max + "k" ) ; var col = "rgb(" + col_map . map [ div ] . R + "," + col_map . map [ div ] . G + "," + col_map . map [ div ] . B + ")" ; fillrect ( i * d , j * d , d , d , col ) ; } } }
Draws a matrix giving the mixing between different age groups
Draws a matrix giving the mixing between different age groups