Index: trunk/Ohana/src/relastro/src/plotstuff.c
===================================================================
--- trunk/Ohana/src/relastro/src/plotstuff.c	(revision 13322)
+++ trunk/Ohana/src/relastro/src/plotstuff.c	(revision 13479)
@@ -21,5 +21,9 @@
 int open_graph (int N) {
 
-  Xgraph[N] = KiiOpen ("kapa", NULL);
+  char name[100];
+
+  sprintf (name, "gastro [%d]", N);
+  Xgraph[N] = KapaOpen ("kapa", name);
+
   if (Xgraph[N] < 0) {
     fprintf (stderr, "error starting kapa\n");
@@ -59,18 +63,7 @@
   if (Xgraph[N] < 1) if (!open_graph(N)) return;
 
-  KapaClear (Xgraph[N], TRUE);
+  KapaClearSections (Xgraph[N]);
 
-  KiiSendCommand (Xgraph[N], 4, "PLOT");
-  
-  /* send Xgraph the plot details */
-  KiiSendMessage (Xgraph[N], "%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 (Xgraph[N], "%g %g %g %g", 
-		  graphmode[0].xmin, graphmode[0].xmax, 
-		  graphmode[0].ymin, graphmode[0].ymax);
-
+  KapaPrepPlot (Xgraph[N], Npts, graphmode);
   return;
 }
@@ -83,5 +76,5 @@
 }
 
-void PlotVector (int Npts, double *vect, int mode, int N) {
+void PlotVector (int Npts, double *vect, int mode, int N, char *type) {
 
   float *values;
@@ -95,6 +88,5 @@
   }
 
-  Nbytes = Npts * sizeof (float);
-  write (Xgraph[N], values, Nbytes);
+  KapaPlotVector (Xgraph[N], Npts, values, type);
   free (values);
   return;
@@ -123,6 +115,6 @@
 
   PrepPlotting (N, graphdata, 0);
-  PlotVector (N, xlist, 0, 0);
-  PlotVector (N, ylist, 1, 0);
+  PlotVector (N, xlist, 0, 0, "x");
+  PlotVector (N, ylist, 1, 0, "y");
   if (label != NULL) PlotLabel (label, 0);
   DonePlotting (graphdata, 0);
