Index: trunk/Ohana/src/opihi/cmd.data/line.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.data/line.c	(revision 7917)
+++ trunk/Ohana/src/opihi/cmd.data/line.c	(revision 10307)
@@ -5,71 +5,29 @@
   int N, Npts;
   Graphdata graphmode;
-  Vector *vecx, *vecy, *dxm, *dxp, *dym, *dyp;
+  float x[2], y[2];
 
   if (!style_args (&graphmode, &argc, argv, -1)) return FALSE;
 
-  /* decide on error bars */
-  dxm = dxp = dym = dyp = NULL;
-  if ((N = get_argument (argc, argv, "-dx"))) {
-    remove_argument (N, &argc, argv);
-    if ((dxm = SelectVector (argv[N], OLDVECTOR, TRUE)) == NULL) return (FALSE);
-    remove_argument (N, &argc, argv);
-  }
-  if ((N = get_argument (argc, argv, "+dx"))) {
-    remove_argument (N, &argc, argv);
-    if ((dxp = SelectVector (argv[N], OLDVECTOR, TRUE)) == NULL) return (FALSE);
-    remove_argument (N, &argc, argv);
-  }
-  if ((N = get_argument (argc, argv, "-dy"))) {
-    remove_argument (N, &argc, argv);
-    if ((dym = SelectVector (argv[N], OLDVECTOR, TRUE)) == NULL) return (FALSE);
-    remove_argument (N, &argc, argv);
-  }
-  if ((N = get_argument (argc, argv, "+dy"))) {
-    remove_argument (N, &argc, argv);
-    if ((dyp = SelectVector (argv[N], OLDVECTOR, TRUE)) == NULL) return (FALSE);
-    remove_argument (N, &argc, argv);
-  }
-
-  if (argc != 3) {
-    gprint (GP_ERR, "USAGE: plot <x> <y>\n");
+  if (argc != 6) {
+    gprint (GP_ERR, "USAGE: line <x> <y> to <x> <y>\n");
     return (FALSE);
   }
+  x[0] = atof(argv[1]);
+  y[0] = atof(argv[2]);
+  x[1] = atof(argv[4]);
+  y[1] = atof(argv[5]);
+
   SetGraph (graphmode);
 
-  /* set errorbar mode (these are NOT sticky) */
+  /* set point style and errorbar mode (these are NOT sticky) */
+  graphmode.style = 0;
   graphmode.etype = 0;
-  if ((dym != NULL) && (dyp == NULL)) dyp = dym;
-  if ((dyp != NULL) && (dym == NULL)) dym = dyp;
-  if ((dyp != NULL) || (dym != NULL)) graphmode.etype |= 0x01;
-  if ((dxm != NULL) && (dxp == NULL)) dxp = dxm;
-  if ((dxp != NULL) && (dxm == NULL)) dxm = dxp;
-  if ((dxp != NULL) || (dxm != NULL)) graphmode.etype |= 0x02;
+
+  if (!PrepPlotting (2, &graphmode)) return (FALSE);
   
-  /* find vectors */
-  if ((vecx = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
-  if ((vecy = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
-  if (vecy[0].Nelements != vecy[0].Nelements) {
-    gprint (GP_ERR, "vectors %s and %s not the same length\n", argv[1], argv[2]);
-    return (FALSE);
-  }
-  
-  Npts = vecx[0].Nelements;
-  if (!PrepPlotting (Npts, &graphmode)) return (FALSE);
-  
-  PlotVector (Npts, vecx[0].elements);
-  PlotVector (Npts, vecy[0].elements);
-  if (graphmode.etype & 0x01) {
-    PlotVector (Npts, dym[0].elements);
-    PlotVector (Npts, dyp[0].elements);
-  }
-  if (graphmode.etype & 0x02) {
-    PlotVector (Npts, dxm[0].elements);
-    PlotVector (Npts, dxp[0].elements);
-  }
+  PlotVector (2, x);
+  PlotVector (2, y);
   
   return (TRUE);
 
 }
-
-
