Index: /branches/eam_branches/Ohana.20100407/src/kapa2/doc/mark.issues.txt
===================================================================
--- /branches/eam_branches/Ohana.20100407/src/kapa2/doc/mark.issues.txt	(revision 27714)
+++ /branches/eam_branches/Ohana.20100407/src/kapa2/doc/mark.issues.txt	(revision 27715)
@@ -1,13 +1,13 @@
 
-
-* need consistency of graph defaults : axis, tick, labels should come from kapa
-* clear should erase current plot
+* option to set window margin
+* option to add section outer box
+* option to set limits based on associated image (and change dynamically...)
+o need consistency of graph defaults : axis, tick, labels should come from kapa
+o clear should erase current plot
 
 -> 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.
+(-pt 100?)
 
 -> DVO does not plot the end-points of histograms properly (e.g., the
@@ -18,3 +18,9 @@
 relay output to the file in the same order. Also, until DVO is closed, the
 output does not appear in the file.
+(fixed both issues)
 
+-> DVO is not consistently placing the x/y axis labels, especially in
+user-defined sections of the plot window. 
+(fixed)
+* box -labelpad -labelpad[x,y] +labelpad[x,y] -
+
Index: /branches/eam_branches/Ohana.20100407/src/kapa2/src/Graphs.c
===================================================================
--- /branches/eam_branches/Ohana.20100407/src/kapa2/src/Graphs.c	(revision 27714)
+++ /branches/eam_branches/Ohana.20100407/src/kapa2/src/Graphs.c	(revision 27715)
@@ -13,7 +13,7 @@
     graph[0].axis[i].min = 0.0;
     graph[0].axis[i].max = 1.0;
-    graph[0].axis[i].isaxis = TRUE;
-    graph[0].axis[i].areticks = TRUE;
-    graph[0].axis[i].islabel = (i < 2);
+    graph[0].axis[i].isaxis = FALSE;
+    graph[0].axis[i].areticks = FALSE;
+    graph[0].axis[i].islabel = FALSE;
     graph[0].axis[i].lweight = 0.0;
     graph[0].axis[i].color = 0;
@@ -23,5 +23,10 @@
   }    
   graph[0].data.ticktextPad = NAN;
-  graph[0].data.labelPad = NAN;
+
+  graph[0].data.labelPadXm = NAN;
+  graph[0].data.labelPadXp = NAN;
+  graph[0].data.labelPadYm = NAN;
+  graph[0].data.labelPadYp = NAN;
+
   graph[0].data.padXm = NAN;
   graph[0].data.padXp = NAN;
@@ -49,4 +54,18 @@
   graph[0].data.flipeast  = 1;		// +East  = -X by default
   graph[0].data.flipnorth = 0;		// +North = +Y by default
+
+  graph[0].data.coords.pc1_1 = graph[0].data.coords.pc2_2 = 1.0;
+  graph[0].data.coords.pc1_2 = graph[0].data.coords.pc2_1 = 0.0;
+  graph[0].data.coords.crval1 = 0.0;
+  graph[0].data.coords.crval2 = 0.0;
+  graph[0].data.coords.crpix1 = 0.0;
+  graph[0].data.coords.crpix2 = 0.0;
+  graph[0].data.coords.cdelt1 = graph[0].data.coords.cdelt2 = 1.0;
+  graph[0].data.flipeast = TRUE;
+  graph[0].data.flipnorth = FALSE;
+  strcpy (graph[0].data.coords.ctype, "RA---LIN");
+  strcpy (graph[0].data.axis, "2222");
+  strcpy (graph[0].data.ticks, "2222");
+  strcpy (graph[0].data.labels, "2222");
 
   graph[0].Nobjects = 0;
@@ -90,9 +109,9 @@
     
   /* reset axes and labels */
-  // for (i = 0; i < 4; i++) {
-  //   graph[0].axis[i].isaxis = FALSE;
-  //   graph[0].axis[i].islabel = FALSE;
-  //   graph[0].axis[i].areticks = FALSE;
-  // }
+  for (i = 0; i < 4; i++) {
+    graph[0].axis[i].isaxis = FALSE;
+    graph[0].axis[i].islabel = FALSE;
+    graph[0].axis[i].areticks = FALSE;
+  }
   for (i = 0; i < 8; i++) {
     strcpy (graph[0].label[i].text, "");
Index: /branches/eam_branches/Ohana.20100407/src/kapa2/src/LoadFrame.c
===================================================================
--- /branches/eam_branches/Ohana.20100407/src/kapa2/src/LoadFrame.c	(revision 27714)
+++ /branches/eam_branches/Ohana.20100407/src/kapa2/src/LoadFrame.c	(revision 27715)
@@ -3,7 +3,5 @@
 int LoadFrame (int sock) {
   
-  int i, color;
-  char Axis[16], Labels[16], Ticks[16];
-  double lweight, ticktextPad, labelPad, padXm, padXp, padYm, padYp;
+  int i;
   Section *section;
   KapaGraphWidget *graph;
@@ -31,10 +29,14 @@
   graph[0].axis[3].pad = graph[0].data.padYp;
 
+  graph[0].axis[0].labelPad = graph[0].data.labelPadXm;
+  graph[0].axis[1].labelPad = graph[0].data.labelPadYm;
+  graph[0].axis[2].labelPad = graph[0].data.labelPadXp;
+  graph[0].axis[3].labelPad = graph[0].data.labelPadYp;
+
   for (i = 0; i < 4; i++) {
     graph[0].axis[i].lweight = graph[0].data.lweight;
     graph[0].axis[i].color = graph[0].data.color;
 
-    graph[0].axis[i].ticktextPad = ticktextPad;
-    graph[0].axis[i].labelPad = labelPad;
+    graph[0].axis[i].ticktextPad = graph[0].data.ticktextPad;
 
     switch (graph[0].data.axis[i]) {
@@ -74,6 +76,7 @@
 
   SetSectionSizes (section);
-  if (USE_XWINDOW) DrawFrame (graph);
-  FlushDisplay ();
+  Refresh();
+  // if (USE_XWINDOW) DrawFrame (graph);
+  // FlushDisplay ();
 
   /* XXX why did I do this??? */
Index: /branches/eam_branches/Ohana.20100407/src/kapa2/src/SetGraphData.c
===================================================================
--- /branches/eam_branches/Ohana.20100407/src/kapa2/src/SetGraphData.c	(revision 27714)
+++ /branches/eam_branches/Ohana.20100407/src/kapa2/src/SetGraphData.c	(revision 27715)
@@ -14,10 +14,7 @@
   if (section->graph == NULL) {
     section->graph = InitGraph ();
-    fprintf (stderr, "pad: %f %f %f\n", section->graph->axis[0].pad, section->graph->axis[0].labelPad, section->graph->axis[0].ticktextPad);
     SetSectionSizes (section);
-    fprintf (stderr, "pad: %f %f %f\n", section->graph->axis[0].pad, section->graph->axis[0].labelPad, section->graph->axis[0].ticktextPad);
   }
   graph = section->graph;
-  fprintf (stderr, "pad: %f %f %f\n", section->graph->axis[0].pad, section->graph->axis[0].labelPad, section->graph->axis[0].ticktextPad);
   
   KapaScanGraphData (sock, &graph[0].data);
@@ -25,6 +22,10 @@
   for (i = 0; i < 4; i++) {
     graph[0].axis[i].ticktextPad = graph[0].data.ticktextPad;
-    graph[0].axis[i].labelPad = graph[0].data.labelPad;
   }    
+  graph[0].axis[0].labelPad = graph[0].data.labelPadXm;
+  graph[0].axis[1].labelPad = graph[0].data.labelPadYm;
+  graph[0].axis[2].labelPad = graph[0].data.labelPadXp;
+  graph[0].axis[3].labelPad = graph[0].data.labelPadYp;
+
   graph[0].axis[0].pad = graph[0].data.padXm;
   graph[0].axis[1].pad = graph[0].data.padYm;
Index: /branches/eam_branches/Ohana.20100407/src/libkapa/include/kapa.h
===================================================================
--- /branches/eam_branches/Ohana.20100407/src/libkapa/include/kapa.h	(revision 27714)
+++ /branches/eam_branches/Ohana.20100407/src/libkapa/include/kapa.h	(revision 27715)
@@ -79,5 +79,6 @@
   int style, ptype, ltype, etype, ebar, color;
   double lweight, size;
-  double ticktextPad, labelPad;
+  double ticktextPad;
+  double labelPadXm, labelPadYm, labelPadXp, labelPadYp;
   double padXm, padXp, padYm, padYp;
   Coords coords;
Index: /branches/eam_branches/Ohana.20100407/src/libkapa/src/KapaWindow.c
===================================================================
--- /branches/eam_branches/Ohana.20100407/src/libkapa/src/KapaWindow.c	(revision 27714)
+++ /branches/eam_branches/Ohana.20100407/src/libkapa/src/KapaWindow.c	(revision 27715)
@@ -139,8 +139,12 @@
 		  data[0].lweight, data[0].size);
 
-  KiiSendMessage (fd, "%g %g %g %g %g %g", 
-		  data[0].ticktextPad, data[0].labelPad, 
+  KiiSendMessage (fd, "%g %g %g %g %g", 
+		  data[0].ticktextPad,
 		  data[0].padXm, data[0].padXp, 
 		  data[0].padYm, data[0].padYp);
+
+  KiiSendMessage (fd, "%g %g %g %g", 
+		  data[0].labelPadXm, data[0].labelPadXp, 
+		  data[0].labelPadYm, data[0].labelPadYp);
 
   KiiSendMessage (fd, "%g %g %g %g", 
@@ -178,8 +182,12 @@
 		  &data[0].lweight, &data[0].size);
 
-  KiiScanMessage (fd, "%lf %lf %lf %lf %lf %lf", 
-		  &data[0].ticktextPad, &data[0].labelPad, 
+  KiiScanMessage (fd, "%lf %lf %lf %lf %lf", 
+		  &data[0].ticktextPad, 
 		  &data[0].padXm, &data[0].padXp, 
 		  &data[0].padYm, &data[0].padYp);
+
+  KiiScanMessage (fd, "%lf %lf %lf %lf", 
+		  &data[0].labelPadXm, &data[0].labelPadXp, 
+		  &data[0].labelPadYm, &data[0].labelPadYp);
 
   KiiScanMessage (fd, "%f %f %f %f", 
Index: /branches/eam_branches/Ohana.20100407/src/opihi/cmd.data/box.c
===================================================================
--- /branches/eam_branches/Ohana.20100407/src/opihi/cmd.data/box.c	(revision 27714)
+++ /branches/eam_branches/Ohana.20100407/src/opihi/cmd.data/box.c	(revision 27715)
@@ -41,5 +41,5 @@
 
   // XXX need to get the current values from kapa
-  strcpy (graphmode.ticks, "2222");
+  // strcpy (graphmode.ticks, "2222");
   if ((N = get_argument (argc, argv, "-ticks"))) {
     remove_argument (N, &argc, argv);
@@ -52,5 +52,5 @@
   }
   
-  strcpy (graphmode.labels, "2222");
+  // strcpy (graphmode.labels, "2222");
   if ((N = get_argument (argc, argv, "-labels"))) {
     remove_argument (N, &argc, argv);
@@ -63,5 +63,5 @@
   }
 
-  strcpy (graphmode.axis, "2222");
+  // strcpy (graphmode.axis, "2222");
   if ((N = get_argument (argc, argv, "-axis"))) {
     remove_argument (N, &argc, argv);
@@ -80,10 +80,45 @@
   }
 
-  if ((N = get_argument (argc, argv, "-labelpad"))) {
+  if ((N = get_argument (argc, argv, "-labelpadx"))) {
     remove_argument (N, &argc, argv);
-    graphmode.labelPad = atof(argv[N]);
+    graphmode.labelPadXm = atof(argv[N]);
     remove_argument (N, &argc, argv);
   }
 
+  if ((N = get_argument (argc, argv, "-labelpady"))) {
+    remove_argument (N, &argc, argv);
+    graphmode.labelPadYm = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((N = get_argument (argc, argv, "+labelpadx"))) {
+    remove_argument (N, &argc, argv);
+    graphmode.labelPadXp = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((N = get_argument (argc, argv, "+labelpady"))) {
+    remove_argument (N, &argc, argv);
+    graphmode.labelPadYp = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((N = get_argument (argc, argv, "-labelpad"))) {
+    remove_argument (N, &argc, argv);
+    graphmode.labelPadXm = atof(argv[N]);
+    graphmode.labelPadXp = atof(argv[N]);
+    graphmode.labelPadYm = atof(argv[N]);
+    graphmode.labelPadYp = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((N = get_argument (argc, argv, "-pad"))) {
+    remove_argument (N, &argc, argv);
+    graphmode.padXm = atof(argv[N]);
+    graphmode.padXp = atof(argv[N]);
+    graphmode.padYm = atof(argv[N]);
+    graphmode.padYp = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
   if ((N = get_argument (argc, argv, "-xpad"))) {
     remove_argument (N, &argc, argv);
Index: /branches/eam_branches/Ohana.20100407/src/opihi/cmd.data/section.c
===================================================================
--- /branches/eam_branches/Ohana.20100407/src/opihi/cmd.data/section.c	(revision 27714)
+++ /branches/eam_branches/Ohana.20100407/src/opihi/cmd.data/section.c	(revision 27715)
@@ -42,5 +42,9 @@
   if ((N = get_argument (argc, argv, "-bg"))) {
     remove_argument (N, &argc, argv);
-    background = KapaColorByName(argv[N]);
+    if (!strcascmp (argv[N], "NONE")) {
+      background = -1;
+    } else {
+      background = KapaColorByName(argv[N]);
+    }
     remove_argument (N, &argc, argv);
     action = BG;
