Index: /trunk/Ohana/src/libkapa/include/kapa.h
===================================================================
--- /trunk/Ohana/src/libkapa/include/kapa.h	(revision 7398)
+++ /trunk/Ohana/src/libkapa/include/kapa.h	(revision 7399)
@@ -113,4 +113,7 @@
 int KapaBox (int fd, Graphdata *graphdata);
 int KapaClear (int fd, int ClearSection);
+int KapaInitGraph (Graphdata *graphdata);
+int KapaPrepPlot (int fd, int Npts, Graphdata *graphmode);
+int KapaPlotVector (int fd, int Npts, float *values);
 int KapaSetFont (int fd, char *name, int size);
 int KapaSendLabel (int fd, char *string, int mode);
Index: /trunk/Ohana/src/libkapa/src/KapaWindow.c
===================================================================
--- /trunk/Ohana/src/libkapa/src/KapaWindow.c	(revision 7398)
+++ /trunk/Ohana/src/libkapa/src/KapaWindow.c	(revision 7399)
@@ -33,4 +33,56 @@
     KiiSendCommand (fd, 4, "ERAS");
   }
+  return (TRUE);
+}
+
+int KapaInitGraph (Graphdata *graphdata) {
+
+  graphdata[0].xmin = graphdata[0].ymin = 0.0;
+  graphdata[0].xmax = graphdata[0].ymax = 1.0;
+  graphdata[0].style = graphdata[0].ptype = 0;
+  graphdata[0].ltype = graphdata[0].color = 0;
+  graphdata[0].etype = graphdata[0].ebar = 0;
+  graphdata[0].lweight = graphdata[0].size = 1.0;
+    
+  graphdata[0].coords.pc1_1 = graphdata[0].coords.pc2_2 = 1.0;
+  graphdata[0].coords.pc1_2 = graphdata[0].coords.pc2_1 = 0.0;
+  strcpy (graphdata[0].coords.ctype, "RA---LIN");
+  graphdata[0].coords.crval1 = 0.0;
+  graphdata[0].coords.crval2 = 0.0;
+  graphdata[0].coords.crpix1 = 0.0;
+  graphdata[0].coords.crpix2 = 0.0;
+  graphdata[0].coords.cdelt1 = graphdata[0].coords.cdelt2 = 1.0;
+  graphdata[0].flipeast = TRUE;
+  graphdata[0].flipnorth = FALSE;
+  strcpy (graphdata[0].axis, "2222");
+  strcpy (graphdata[0].ticks, "2222");
+  strcpy (graphdata[0].labels, "2222");
+
+  return (TRUE);
+}
+
+int KapaPrepPlot (int fd, int Npts, Graphdata *graphmode) {
+
+  /* tell kapa to look for the incoming image */
+  KiiSendCommand (fd, 4, "PLOT"); 
+  
+  /* send Xgraph the plot details */
+  KiiSendMessage (fd, "%8d %8d %d %d %d %d %d %f %f", 
+		  Npts, graphmode[0].style, 
+		  graphmode[0].ptype, graphmode[0].ltype, 
+		  graphmode[0].etype, graphmode[0].ebar, graphmode[0].color, 
+		  graphmode[0].lweight, graphmode[0].size);
+  KiiSendMessage (fd, "%g %g %g %g", 
+		  graphmode[0].xmin, graphmode[0].xmax, 
+		  graphmode[0].ymin, graphmode[0].ymax);
+  return (TRUE);
+}
+
+int KapaPlotVector (int fd, int Npts, float *values) {
+
+  int Nbytes;
+
+  Nbytes = Npts * sizeof (float);
+  write (fd, values, Nbytes);
   return (TRUE);
 }
