Actual source code: ex2.c

  1: /*$Id: ex2.c,v 1.35 2001/08/07 21:28:44 bsmith Exp $*/

  3: static char help[] = "Demonstrates us of color mapn";

 5:  #include petsc.h

  7: int main(int argc,char **argv)
  8: {
  9:   PetscDraw draw;
 10:   int     ierr,x = 0,y = 0,width = 256,height = 256,i;

 12:   PetscInitialize(&argc,&argv,(char*)0,help);

 14:   /* PetscDrawOpenX(PETSC_COMM_SELF,0,"Title",x,y,width,height,&draw);*/
 15:   PetscDrawCreate(PETSC_COMM_SELF,0,"Title",x,y,width,height,&draw);
 16:   PetscDrawSetFromOptions(draw);
 17:   for (i=0; i<256; i++) {
 18:     PetscDrawLine(draw,0.0,((PetscReal)i)/256.,1.0,((PetscReal)i)/256.,i);
 19:   }
 20:   PetscDrawFlush(draw);
 21:   PetscSleep(2);
 22:   PetscDrawDestroy(draw);
 23:   PetscFinalize();
 24:   return 0;
 25: }
 26: