Index: /branches/eam_branches/ipp-20150419/Ohana/src/kapa2/src/SetGraphSize.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/kapa2/src/SetGraphSize.c	(revision 38311)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/kapa2/src/SetGraphSize.c	(revision 38312)
@@ -21,6 +21,6 @@
   double X0 = graphic[0].dx * section[0].x  + x0;
   double Y0 = graphic[0].dy * section[0].y  + y0;
-  double dX = graphic[0].dx * section[0].dx - x1;
-  double dY = graphic[0].dy * section[0].dy - y1;
+  double dX = MAX(graphic[0].dx * section[0].dx - x1, 1);
+  double dY = MAX(graphic[0].dy * section[0].dy - y1, 1);
 
   /* define locations of coordinate axes */
Index: /branches/eam_branches/ipp-20150419/Ohana/src/kapa2/src/SetImageSize.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/kapa2/src/SetImageSize.c	(revision 38311)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/kapa2/src/SetImageSize.c	(revision 38312)
@@ -306,6 +306,6 @@
 	image[0].picture.x = Xs + PAD1;
 	image[0].picture.y = Ys + 2*PAD1 + COLORPAD;
-	image[0].picture.dx = dX - 3*PAD1 - 1 - ZOOM_X; 
-	image[0].picture.dy = dY - 3*PAD1 - 1 - COLORPAD;
+	image[0].picture.dx = MAX(dX - 3*PAD1 - 1 - ZOOM_X, 1); 
+	image[0].picture.dy = MAX(dY - 3*PAD1 - 1 - COLORPAD, 1);
       }
 
