[GRASS-SVN] r69614 - grass/trunk/display/d.linegraph

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Sep 30 14:31:41 PDT 2016


Author: wenzeslaus
Date: 2016-09-30 14:31:41 -0700 (Fri, 30 Sep 2016)
New Revision: 69614

Modified:
   grass/trunk/display/d.linegraph/main.c
Log:
d.linegraph: add min and max for y

Modified: grass/trunk/display/d.linegraph/main.c
===================================================================
--- grass/trunk/display/d.linegraph/main.c	2016-09-30 19:25:55 UTC (rev 69613)
+++ grass/trunk/display/d.linegraph/main.c	2016-09-30 21:31:41 UTC (rev 69614)
@@ -8,7 +8,7 @@
  *               Huidae Cho <grass4u gmail.com>, Glynn Clements <glynn gclements.plus.com>, 
  *               Hamish Bowman <hamish_b yahoo.com>
  * PURPOSE:      
- * COPYRIGHT:    (C) 1999-2007 by the GRASS Development Team
+ * COPYRIGHT:    (C) 1999-2016 by the GRASS Development Team
  *
  *               This program is free software under the GNU General Public
  *               License (>=v2). Read the file COPYING that comes with GRASS
@@ -110,6 +110,7 @@
     struct Option *y_color_opt;
     struct Option *title[3];
     struct Option *t_color_opt;
+    struct Option *y_min, *y_max;
 
     /* Initialize the GIS calls */
     G_gisinit(argv[0]);
@@ -180,7 +181,18 @@
     title[2]->required = NO;
     title[2]->answer = "";
 
+    y_min = G_define_option();
+    y_min->key = "y_min";
+    y_min->description = _("Minimum value for Y axis");
+    y_min->type = TYPE_DOUBLE;
+    y_min->required = NO;
 
+    y_max = G_define_option();
+    y_max->key = "y_max";
+    y_max->description = _("Maximum value for Y axis");
+    y_max->type = TYPE_DOUBLE;
+    y_max->required = NO;
+
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
@@ -321,6 +333,11 @@
 	}
     }
 
+    if (y_min->answer)
+        min_y = atof(y_min->answer);
+    if (y_max->answer)
+        max_y = atof(y_max->answer);
+
     /* close all files */
 
     for (i = 0; i <= num_y_files; i++)



More information about the grass-commit mailing list