//      PROGRAM PGDE10
//-----------------------------------------------------------------------
// Demonstration program for PGPLOT. 
// This program shows how the default colors can be 
// overridden with PGSCRN (or PGSCR). On some devices (those with a color
// lookup table), changing the background color (color index 0) takes 
// effect immediately, but on others it only affects elements that are
// explicitly drawn in the background color. Thus it is necessary to fill
// the page with the background color, which is here done with PGERAS,
// before drawing anything else (this means that PGENV cannot be used).
//-----------------------------------------------------------------------
      XS = YS = floatarray(9)
      XR = YR = floatarray(101)
      IER = 0

// Start a new page.

      print "This program is intended for use with color displays"
      if (pgbeg(0,plotdevice,1,1) != 1) break
      pgpage

// Override default colors.

      pgscrn 0, "DarkSlateGray"//, IER
      pgscrn 1, "White"//, IER
      pgscrn 2, "Yellow"//, IER
      pgscrn 3, "Cyan"//, IER
      pgscrn 4, "SlateGray"//, IER

// "Erase" the screen to fill with background color.

      pgeras

// Set up window and viewport.

      pgsch 1.5
      pgvstd
      pgswin 0.,10.,0.,0.65

// Fill the viewport in a different color.

      pgsci 4
      pgrect 0., 10., 0., 0.65

// Annotation.

      pgsci 0
      pgbox "G", 0.0, 0, "G", 0.0, 0
      pgsci 1
      pgslw 3
      pgscf 2
      pgbox "BCNST", 0.0, 0, "BCNSTV", 0.0, 0
      pglab "\fix", " ", "\frPGPLOT Graph: \fi y = x\u\fr2\de\u-\fix\d"

// Plot the graph.

      for I=1,101 {
          XR[I] = 0.1*(I-1)
          YR[I] = XR[I]^2*exp(-XR[I])
      }
      for I=1,9 {
          XS[I] = I
          YS[I] = XS[I]^2*exp(-XS[I])
      }
      pgsci 2
      pgslw 4
      pgline 101,XR,YR
      pgsci 3
      pgsch 3.0
      pgpt 9,XS,YS,18

// Done.

      pgend
