/* SYMBOL statements for the plot. */
symbol1 i=join c=black v=star;
symbol2 i=join c=red v=square;
symbol3 i=join c=green v=diamond;
symbol4 i=join c=blue v=circle;
symbol5 i=join c=cyan v=triangle;
symbol6 i=join c=magenta v=plus;
       /* AXIS statements. */

   /* Set the range and order of the vertical axis. */
axis1 order=0 to 60 by 10
      color=black                /* Set axis color.   */
      value=(h=3 f=swissl)       /* Define font and size for values.  */
      label=(h=3 f=swissl a=90 'Activity Levels') /* Define axis label. */
      ;

   /* Set the order the values are plotted. */
axis2 order=('cnt' 'adx' 'ovx' 'avx')
      color=black  /* Set horizontal axis color. */
      value=(h=3 f=swissl
             'Controls' 'Adrenalectomy'
             'Ovariectomy' 'Adren./Ovariect.') /* Define font and size */
                                               /* for values and label */
                                               /* values on the axis.  */
      label=(h=3 f=swissl 'Treatment')         /* Define axis label.   */
      ;
   /* LEGEND statements. */
legend1 cborder=black /* Put the legend in a box. */
        label=none /* Suppress the label. */
        value=(f=swissl h=2 ) /* Define font and size for values. */
        ;

goptions cback=white /* White background. */
         ctext=black /* Black text. */
         gunit=pct  /* Set graphics units to percent. */
         ;

proc gplot;
  plot con*surgery=1
       brom*surgery=2  /* Create lines on graph using the  */
       nal*surgery=3   /* Symbol statements defined above. */
       morph*surgery=4
       bmor*surgery=5
       nmor*surgery=6 /
           overlay   /* Plot all the lines on one graph. */
           haxis=axis2  /* Horizontal axis. */
           vaxis=axis1  /* Vertical axis. */
           legend=legend1 /* Define legend. */
           name='plot1'  /* Store under this name in graph catalog, */
                         /* WORK.GSEG, the default catalog.         */
           ;
run;

   /* Use proc greplay to combine the graphics. */
proc greplay igout=work.gseg    /* Graph catalog.    */
             nofs    /* Do not run interactively.    */
             ;

   tc temp; /* Select (or create) a template catalog. */

   tdef test /* Define a template using x and y percentages of display. */

               /* Define panel 1 as a full screen template. */
       1/ llx=0 lly=0 ulx=0 uly=100 urx=100 ury=100 lrx=100 lry=0

           /* Define panel 2 as a Template in upper right of display. */

       2/ llx=55 lly=55 ulx=55 uly=100 urx=100 ury=100 lrx=100 lry=55 ;

  template test;  /* Use the just defined template. */
  treplay 1:plot1 2:test1; /* Display the graphic, placing plot1 in panel1 */
                           /* panel1 and test1 in panel 2.                 */
run;
quit;