/* plot_mat: creates a simple colour-coded dot representation of Mat, * which is assumed to be a Row x Col matrix. The colours vary from * blue for Lowval values to red for Upval values. Values lower than * Lowval will be black, higher than Upval will be white. * Plotting is performed in window no. Gid. * Call winclose() to dispose of this window. */ void plot_mat(long Gid, double **Mat, unsigned int Row, unsigned int Col, double Lowval, double Upval) { register unsigned int i,j; winset(Gid); /* make this the current window */ reshapeviewport(); cpack(RGB_BLACK); clear(); for (i=0; i<Row; i++) /* scans Mat */ for (j=0; j<Col; j++) { /* select code color for Mt values */ cpack(rainbow_ramp(Mat[i][j], Lowval, Upval)); /* plot the point */ rectfi(j, Row-i, j+1, Row-i-1); } /* flush graphics */ if (Dblbuffer) swapbuffers(); else gflush(); }
void do_clg (void) { graphic_mode(); gclear(); gflush(); }