Index: /branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro/src/relastroVisual.c
===================================================================
--- /branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro/src/relastroVisual.c	(revision 22725)
+++ /branches/cnb_branches/cnb_branch_20090301/Ohana/src/relastro/src/relastroVisual.c	(revision 22726)
@@ -64,15 +64,17 @@
 static int plotVectorField(float x[], float y[],
                            float xVec[], float yVec[],
-                           int npts, int kapaID,
-                           Graphdata *graphdata, int overplot) {
-
-    float singleX[2], singleY[2];
-    float maxVecLength, vecScaleFactor;
-    float graphSize;
-    int i;
-
-    if (!initWindow(&kapaID)) return 0;
-
-    if (!overplot) scaleGraphdata(x, y, graphdata, npts);
+                           int npts, int *kapaID) {
+
+  Graphdata graphdata;  
+  float singleX[2], singleY[2];
+  float maxVecLength, vecScaleFactor;
+  float graphSize;
+  int i;
+
+    if (!initWindow(kapaID)) return 0;
+
+    KapaInitGraph(&graphdata);
+    KapaClearPlots(*kapaID);
+    scaleGraphdata(x, y, &graphdata, npts);
 
     //scale the raw xvec, yvecs down to fit into the window
@@ -86,26 +88,23 @@
         }
     }
-    graphSize = graphdata->xmax - graphdata->xmin;
-    if ((graphdata->ymax - graphdata->ymin) > graphSize) {
-        graphSize = graphdata->ymax - graphdata->ymin;
+    graphSize = graphdata.xmax - graphdata.xmin;
+    if ((graphdata.ymax - graphdata.ymin) > graphSize) {
+        graphSize = graphdata.ymax - graphdata.ymin;
     }
     vecScaleFactor = graphSize * 0.1 / maxVecLength;
 
-    //plot the points as circles
-    if (!overplot) {
-        KapaSetFont (kapaID, "helvetica", 14);
-        KapaSetLimits(kapaID, graphdata);
-        KapaBox(kapaID, graphdata);
-    }
-
-    graphdata->ptype = 7;
-    graphdata->style = 2;
-    KapaPrepPlot(kapaID, npts, graphdata);
-    KapaPlotVector(kapaID, npts, x, "x");
-    KapaPlotVector(kapaID, npts, y, "y");
+    KapaSetFont (*kapaID, "helvetica", 14);
+    KapaSetLimits(*kapaID, &graphdata);
+    KapaBox(*kapaID, &graphdata);
+    
+    graphdata.ptype = 7;
+    graphdata.style = 2;
+    KapaPrepPlot(*kapaID, npts, &graphdata);
+    KapaPlotVector(*kapaID, npts, x, "x");
+    KapaPlotVector(*kapaID, npts, y, "y");
 
     //plot each vector individually
-    graphdata->ptype = 0;
-    graphdata->style = 0;
+    graphdata.ptype = 0;
+    graphdata.style = 0;
     for(i = 0; i < npts; i++) {
         singleX[0] = x[i];
@@ -114,7 +113,7 @@
         singleY[1] = yVec[i] * vecScaleFactor;
 
-        KapaPrepPlot(kapaID, 2, graphdata);
-        KapaPlotVector(kapaID, 2, singleX, "x");
-        KapaPlotVector(kapaID, 2, singleY, "y");
+        KapaPrepPlot(*kapaID, 2, &graphdata);
+        KapaPlotVector(*kapaID, 2, singleX, "x");
+        KapaPlotVector(*kapaID, 2, singleY, "y");
     }
     return 1;
@@ -194,6 +193,5 @@
   }
 
-  plotVectorField(refX, refY, xVec, yVec, numFit, kapa2,
-                  &graphdata, 0);
+  plotVectorField(refX, refY, xVec, yVec, numFit, &kapa2);
 
   KapaSetFont(kapa, "helvetica", 14);
