Date: 2013-07-02T14:38:28+00:00

Actual source code: ex4.c
petsc-3.4.2 2013-07-02

      2: static char help[] = "Demonstrates use of PetscDrawZoom()\n";

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

      9: PetscErrorCode zoomfunction(PetscDraw draw,void *dummy)
     10: {
     12:   int            i;

     14:   for (i=0; i<256; i++) {
     15:     PetscDrawLine(draw,0.0,((PetscReal)i)/256.,1.0,((PetscReal)i)/256.,i);
     16:   }
     17:   return 0;
     18: }

     22: int main(int argc,char **argv)
     23: {
     24:   PetscDraw      draw;
     25:   int            x = 0,y = 0,width = 256,height = 256;

     28:   PetscInitialize(&argc,&argv,(char*)0,help);
     29:   PetscDrawCreate(PETSC_COMM_SELF,0,"Title",x,y,width,height,&draw);
     30:   PetscDrawSetFromOptions(draw);
     31:   PetscDrawZoom(draw,zoomfunction,NULL);
     32:   PetscDrawDestroy(&draw);
     33:   PetscFinalize();
     34:   return 0;
     35: }