Actual source code: ex11.c

petsc-3.6.1 2015-08-06
Report Typos and Errors
  2: static char help[] = "Demonstrates use of color map\n";

  4: #include <petscsys.h>
  5: #include <petscdraw.h>

  9: int main(int argc,char **argv)
 10: {
 11:   PetscDraw      draw;

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

 16:   PetscDrawCreate(PETSC_COMM_SELF,0,"Title",0,0,256,256,&draw);
 17:   PetscDrawSetFromOptions(draw);

 19:   PetscDrawStringBoxed(draw,.5,.5,PETSC_DRAW_BLUE,PETSC_DRAW_RED,"Greetings",NULL,NULL);

 21:   PetscDrawStringBoxed(draw,.25,.75,PETSC_DRAW_BLUE,PETSC_DRAW_RED,"How\nare\nyou?",NULL,NULL);
 22:   PetscDrawStringBoxed(draw,.25,.25,PETSC_DRAW_GREEN,PETSC_DRAW_RED,"Long line followed by a very\nshort line",NULL,NULL);
 23:   PetscDrawFlush(draw);
 24:   PetscDrawDestroy(&draw);
 25:   PetscFinalize();
 26:   return 0;
 27: }