Index: trunk/Ohana/src/kapa2/include/structures.h
===================================================================
--- trunk/Ohana/src/kapa2/include/structures.h	(revision 41375)
+++ trunk/Ohana/src/kapa2/include/structures.h	(revision 41376)
@@ -165,4 +165,5 @@
   double fLabelRange;
   double fMinor;
+  double dMajor;
   int color;
 } Axis;
Index: trunk/Ohana/src/kapa2/src/DrawFrame.c
===================================================================
--- trunk/Ohana/src/kapa2/src/DrawFrame.c	(revision 41375)
+++ trunk/Ohana/src/kapa2/src/DrawFrame.c	(revision 41376)
@@ -18,4 +18,5 @@
   Py = 0.5 * (1 + 0.25*graph[0].axis[1].lweight) * (hypot (graph[0].axis[1].dfx, graph[0].axis[1].dfy) + hypot (graph[0].axis[1].dfx, graph[0].axis[1].dfy));
   int P = MIN (Px, Py);
+  // fprintf (stderr, "P: %d\n", P);
 
   /* each axis is drawn independently, but ticks and labels are placed according to perpendicular distance. */
Index: trunk/Ohana/src/kapa2/src/Graphs.c
===================================================================
--- trunk/Ohana/src/kapa2/src/Graphs.c	(revision 41375)
+++ trunk/Ohana/src/kapa2/src/Graphs.c	(revision 41376)
@@ -25,4 +25,5 @@
     graph[0].axis[i].fLabelRange = 1.0;
     graph[0].axis[i].fMinor = 5.0;
+    graph[0].axis[i].dMajor = NAN;
     memset (graph[0].axis[i].format, 0, 16);
   }    
Index: trunk/Ohana/src/kapa2/src/LoadFrame.c
===================================================================
--- trunk/Ohana/src/kapa2/src/LoadFrame.c	(revision 41375)
+++ trunk/Ohana/src/kapa2/src/LoadFrame.c	(revision 41376)
@@ -42,8 +42,19 @@
   graph[0].axis[3].fLabelRange = graph[0].data.fLabelRangeYp;
 
+  // fMinor and dMajor should have defaults of NAN
+  // with default behavior defined in TickMarks.c
+  // for one axis (x or y), if both + and - are
+  // NAN, keep the default behavior, but if one
+  // is NOT NAN, use that for both (synchronization)
+
   graph[0].axis[0].fMinor = graph[0].data.fMinorXm;
   graph[0].axis[1].fMinor = graph[0].data.fMinorYm;
   graph[0].axis[2].fMinor = graph[0].data.fMinorXp;
   graph[0].axis[3].fMinor = graph[0].data.fMinorYp;
+
+  graph[0].axis[0].dMajor = graph[0].data.dMajorXm;
+  graph[0].axis[1].dMajor = graph[0].data.dMajorYm;
+  graph[0].axis[2].dMajor = graph[0].data.dMajorXp;
+  graph[0].axis[3].dMajor = graph[0].data.dMajorYp;
 
   strcpy (graph[0].axis[0].format, graph[0].data.formatXm);
Index: trunk/Ohana/src/kapa2/src/PDF_Frame.c
===================================================================
--- trunk/Ohana/src/kapa2/src/PDF_Frame.c	(revision 41375)
+++ trunk/Ohana/src/kapa2/src/PDF_Frame.c	(revision 41376)
@@ -86,7 +86,7 @@
 
   if (tick->IsMajor) { 
-    size = MIN (0.50*P, MAX (0.030 * P, 10.0)); 
+    size = MIN (0.50*P, MAX (0.010 * P, 10.0)); 
   } else {
-    size = MIN (0.25*P, MAX (0.015 * P, 5.0)); 
+    size = MIN (0.25*P, MAX (0.005 * P, 5.0)); 
   }
   dir = ((naxis == 2) || (naxis == 3)) ? -1 : +1;
Index: trunk/Ohana/src/kapa2/src/SetGraphData.c
===================================================================
--- trunk/Ohana/src/kapa2/src/SetGraphData.c	(revision 41375)
+++ trunk/Ohana/src/kapa2/src/SetGraphData.c	(revision 41376)
@@ -37,4 +37,9 @@
   graph[0].axis[2].fMinor = graph[0].data.fMinorXp;
   graph[0].axis[3].fMinor = graph[0].data.fMinorYp;
+
+  graph[0].axis[0].dMajor = graph[0].data.dMajorXm;
+  graph[0].axis[1].dMajor = graph[0].data.dMajorYm;
+  graph[0].axis[2].dMajor = graph[0].data.dMajorXp;
+  graph[0].axis[3].dMajor = graph[0].data.dMajorYp;
 
   strcpy (graph[0].axis[0].format, graph[0].data.formatXm);
Index: trunk/Ohana/src/kapa2/src/TickMarks.c
===================================================================
--- trunk/Ohana/src/kapa2/src/TickMarks.c	(revision 41375)
+++ trunk/Ohana/src/kapa2/src/TickMarks.c	(revision 41376)
@@ -19,5 +19,5 @@
 
   // be a little generous 
-  NTICKS = (int)(fabs(range / minor)) + 2;
+  NTICKS = MIN((int)(fabs(range / minor)) + 2, 1000);
   ALLOCATE (ticks, TickMarkData, NTICKS);
 
@@ -101,4 +101,5 @@
   double lrange, factor, mantis, fmantis, power;
 
+  // range is the full range of the plot axis (e.g., 10 - 1010 : range = 1000)
   *range = axis->fLabelRange*(axis[0].max - axis[0].min);
   if (fabs(*range) < MIN_RANGE) {
@@ -106,8 +107,13 @@
   }
 
+  // lrange : log of the full range (e.g., 3000 -> ~3.5)
   lrange = log10(MAX(fabs(*range), MIN_RANGE));
   double truncRange = ((int) ((lrange + 0.005) * 1000)) / 1000.0;
   lrange = truncRange;
 
+  // split the lrange into the integer and fractional portions
+  // e.g., range = 3000, lrange ~ 3.5, factor = 3, mantis = 0.5
+  // if lrange is negative (range < 1), and mantis is negative, shift so mantis positive
+  // e.g., range = 0.2, lrange = -0.69, mantis = -0.69, factor = 0 -> factor = -1, mantis = 0.301 (2 x 0.1 instead of 0.2 x 1)
   mantis = modf (lrange, &factor);
   if (mantis < 0.0) {
@@ -115,11 +121,12 @@
     factor -= 1.0;
   }
-  
+
   // how many significant digits are needed?
 
+  // power is 10^factor above, e.g., range = 3000, factor = 3, power = 1000 (integer power-of-ten)
+  // fmantis is the 10^mantis above, e.g., range = 3000, mantis = 0.5, fmantis = 3
   power = MAX(pow(10.0, factor), MIN_RANGE);
   fmantis = pow(10.0, mantis);
   *major = MAX(0.5 * power, MIN_RANGE);
-  *minor = MAX(0.1 * power, MIN_RANGE);
   
   if ((fmantis >= 1.0) && (fmantis <  1.999)) {
@@ -183,4 +190,6 @@
     }	  
   }
+  if (isfinite(axis->dMajor)) *major = axis->dMajor;
+
   *minor = *major / axis->fMinor;
 }
Index: trunk/Ohana/src/kapa2/src/bDrawFrame.c
===================================================================
--- trunk/Ohana/src/kapa2/src/bDrawFrame.c	(revision 41375)
+++ trunk/Ohana/src/kapa2/src/bDrawFrame.c	(revision 41376)
@@ -16,4 +16,5 @@
   int Py = 0.5 * (1 + 0.25*graph[0].axis[1].lweight) * (hypot (graph[0].axis[1].dfx, graph[0].axis[1].dfy) + hypot (graph[0].axis[1].dfx, graph[0].axis[1].dfy));
   int P = MIN (Px, Py);
+  // fprintf (stderr, "P: %d\n", P);
 
   /* each axis is drawn independently */
@@ -81,7 +82,7 @@
 
   if (tick->IsMajor) { 
-    size = MIN (0.50*P, MAX (0.030 * P, 10.0)); 
+    size = MIN (0.50*P, MAX (0.010 * P, 10.0)); 
   } else {
-    size = MIN (0.25*P, MAX (0.015 * P, 5.0)); 
+    size = MIN (0.25*P, MAX (0.005 * P, 5.0)); 
   }
   dir = ((naxis == 0) || (naxis == 3)) ? -1 : +1;
