Index: /trunk/Ohana/src/kapa2/doc/mark.issues.txt
===================================================================
--- /trunk/Ohana/src/kapa2/doc/mark.issues.txt	(revision 25918)
+++ /trunk/Ohana/src/kapa2/doc/mark.issues.txt	(revision 25918)
@@ -0,0 +1,15 @@
+-> The "plot" command needs to be fixed so that boundaries of contours do
+not cause it to draw excessive amounts of lines connecting unrelated
+contours. A specific "contour line type" would be useful.
+
+-> DVO is not consistently placing the x/y axis labels, especially in
+user-defined sections of the plot window.
+
+-> DVO does not plot the end-points of histograms properly (e.g., the
+line from the final data point on each end down to the x-axis is missing)
+(fixed)
+
+-> When opening a file of output, the "echo" and "fprintf" commands do not
+relay output to the file in the same order. Also, until DVO is closed, the
+output does not appear in the file.
+
Index: /trunk/Ohana/src/kapa2/src/DrawObjects.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/DrawObjects.c	(revision 25917)
+++ /trunk/Ohana/src/kapa2/src/DrawObjects.c	(revision 25918)
@@ -181,4 +181,5 @@
 
 /******/
+/* simplify the code abit by finding triplets, watch out for a histogram of 2 points */
 void DrawHistogram (KapaGraphWidget *graph, Gobjects *object) {
 
@@ -186,5 +187,5 @@
   float *x, *y;
   double mxi, mxj, myi, myj, bxi, bxj, byi, byj, bx, by;
-  double sx0, sy0, sx1, sy1, sxa;
+  double sx0, sy0, sx1, sy1, sxa, sya, sxo, syo;
   double X0, X1, Y0, Y1;
 
@@ -211,8 +212,34 @@
   for (i = 0; (i < object[0].Npts) && !(finite(x[i]) && finite(y[i])); i++);
   if (i >= object[0].Npts) return;
+
+  /* first valid data point */
   sx0 = x[i]*mxi + y[i]*mxj + bx;
   sy0 = x[i]*myi + y[i]*myj + by;
   sx0 = MIN (MAX (sx0, X0), X1);
   sy0 = MAX (MIN (sy0, Y0), Y1);
+  
+  /* find the second valid datapoint */
+  for (i++; (i < object[0].Npts) && !(finite(x[i]) && finite(y[i])); i++);
+  if (i >= object[0].Npts) return;
+
+  /* second valid data point */
+  sx1 = x[i]*mxi + y[i]*mxj + bx;
+  sy1 = x[i]*myi + y[i]*myj + by;
+  sx1 = MIN (MAX (sx1, X0), X1);
+  sy1 = MAX (MIN (sy1, Y0), Y1);
+  
+  /* connect first point to second point */
+  sxa = sx0 - 0.5*(sx1 - sx0);
+  sya = MAX (sy0, Y0);
+  DrawLine (sx0, sy0, sxa, sy0);
+  DrawLine (sxa, sy0, sxa, sya);
+  
+  /* draw segment equal distance behind first point and down to x-axis */
+  sxa = 0.5*(sx0 + sx1);
+  DrawLine (sx0, sy0, sxa, sy0);
+  DrawLine (sxa, sy0, sxa, sy1);
+  DrawLine (sxa, sy1, sx1, sy1);
+  sx0 = sx1;
+  sy0 = sy1;
   
   /* continue with rest of points */
@@ -227,7 +254,99 @@
     DrawLine (sxa, sy0, sxa, sy1);
     DrawLine (sxa, sy1, sx1, sy1);
+    sxo = sx0; syo = sy0;
     sx0 = sx1; sy0 = sy1;
   }
-}
+  
+  /* draw segment equal distance after last point and down to x-axis */
+  sxa = sx1 + 0.5*(sx1 - sxo);
+  sya = MAX (sy1, Y0);
+  DrawLine (sx1, sy1, sxa, sy1);
+  DrawLine (sxa, sy1, sxa, sya);
+}
+
+/* 
+void FillHistogram (KapaGraphWidget *graph, Gobjects *object) {
+
+  int i;
+  float *x, *y;
+  double mxi, mxj, myi, myj, bxi, bxj, byi, byj, bx, by;
+  double sx0, sy0, sx1, sy1, sxa, sya, sxo, syo;
+  double X0, X1, Y0, Y1;
+
+  mxi = graph[0].axis[0].dfx / (object[0].x1 - object[0].x0);
+  mxj = graph[0].axis[1].dfx / (object[0].y1 - object[0].y0);
+  myi = graph[0].axis[0].dfy / (object[0].x1 - object[0].x0);
+  myj = graph[0].axis[1].dfy / (object[0].y1 - object[0].y0);
+  
+  bxi  =  graph[0].axis[0].fx - object[0].x0*graph[0].axis[0].dfx/(object[0].x1 - object[0].x0);
+  bxj  =  -object[0].y0*graph[0].axis[1].dfx/(object[0].y1 - object[0].y0);
+  byi  =  -object[0].x0*graph[0].axis[0].dfy/(object[0].x1 - object[0].x0);
+  byj  =  graph[0].axis[1].fy - object[0].y0*graph[0].axis[1].dfy/(object[0].y1 - object[0].y0);
+  
+  bx = bxi + bxj;
+  by = byi + byj;
+  
+  X0 = graph[0].axis[0].fx;
+  X1 = graph[0].axis[0].fx + graph[0].axis[0].dfx;
+  Y0 = graph[0].axis[1].fy;
+  Y1 = graph[0].axis[1].fy + graph[0].axis[1].dfy;
+
+  /* find the first valid datapoint */
+  x = object[0].x; y = object[0].y;
+  for (i = 0; (i < object[0].Npts) && !(finite(x[i]) && finite(y[i])); i++);
+  if (i >= object[0].Npts) return;
+
+  /* first valid data point */
+  sx0 = x[i]*mxi + y[i]*mxj + bx;
+  sy0 = x[i]*myi + y[i]*myj + by;
+  sx0 = MIN (MAX (sx0, X0), X1);
+  sy0 = MAX (MIN (sy0, Y0), Y1);
+  
+  /* find the second valid datapoint */
+  for (i++; (i < object[0].Npts) && !(finite(x[i]) && finite(y[i])); i++);
+  if (i >= object[0].Npts) return;
+
+  /* second valid data point */
+  sx1 = x[i]*mxi + y[i]*mxj + bx;
+  sy1 = x[i]*myi + y[i]*myj + by;
+  sx1 = MIN (MAX (sx1, X0), X1);
+  sy1 = MAX (MIN (sy1, Y0), Y1);
+  
+  /* connect first point to second point */
+  sxa = sx0 - 0.5*(sx1 - sx0);
+  sya = MAX (sy0, Y0);
+  DrawLine (sx0, sy0, sxa, sy0);
+  DrawLine (sxa, sy0, sxa, sya);
+  
+  /* draw segment equal distance behind first point and down to x-axis */
+  sxa = 0.5*(sx0 + sx1);
+  DrawLine (sx0, sy0, sxa, sy0);
+  DrawLine (sxa, sy0, sxa, sy1);
+  DrawLine (sxa, sy1, sx1, sy1);
+  sx0 = sx1;
+  sy0 = sy1;
+  
+  /* continue with rest of points */
+  for (i++; i < object[0].Npts; i++) {
+    if (!(finite(x[i]) && finite(y[i]))) continue;
+    sx1 = x[i]*mxi + y[i]*mxj + bx;
+    sy1 = x[i]*myi + y[i]*myj + by;
+    sx1 = MIN (MAX (sx1, X0), X1);
+    sy1 = MAX (MIN (sy1, Y0), Y1);
+    sxa = 0.5*(sx0 + sx1);
+    DrawLine (sx0, sy0, sxa, sy0);
+    DrawLine (sxa, sy0, sxa, sy1);
+    DrawLine (sxa, sy1, sx1, sy1);
+    sxo = sx0; syo = sy0;
+    sx0 = sx1; sy0 = sy1;
+  }
+  
+  /* draw segment equal distance after last point and down to x-axis */
+  sxa = sx1 + 0.5*(sx1 - sxo);
+  sya = MAX (sy1, Y0);
+  DrawLine (sx1, sy1, sxa, sy1);
+  DrawLine (sxa, sy1, sxa, sya);
+}
+*/
 
 /******/
