Bladeren bron

added flip legend flap

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@33527 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 16 jaren geleden
bovenliggende
commit
9df7b5911a
2 gewijzigde bestanden met toevoegingen van 17 en 8 verwijderingen
  1. 15 7
      scripts/d.rast.leg/d.rast.leg
  2. 2 1
      scripts/d.rast.leg/d.rast.leg.html

+ 15 - 7
scripts/d.rast.leg/d.rast.leg

@@ -29,8 +29,8 @@
 #
 # See also:	d.rast, d.legend.
 #
-# Markus Neteler 8/2002: added simple d.legend logic
 # Jianping Xu and Scott Madry, Rutgers University. October 19, 1993
+# Markus Neteler 8/2002: added simple d.legend logic
 # Markus Neteler 10/2003: added g.parser
 # Michael Barton 12/2004: remove reference to (null)
 ##############################################################################
@@ -40,9 +40,13 @@
 #%  keywords: display
 #%End
 #%flag
+#%  key: f
+#%  description: Flip legend
+#%end
+#%flag
 #%  key: n
-#%  description: omit entries with missing label
-#%END
+#%  description: Omit entries with missing label
+#%end
 #%option
 #% key: map
 #% type: string
@@ -70,6 +74,10 @@ if [ $GIS_FLAG_N -eq 1 ] ; then
   OMIT="-n"
 fi
 
+if [ $GIS_FLAG_F -eq 1 ] ; then
+  FLIP="-f"
+fi
+
 #for -n flag of d.legend
 eval `g.findfile el=cell file=$GIS_OPT_MAP`
 if [ ! "$file" ] ; then
@@ -103,9 +111,9 @@ then
        #draw legend
     	d.frame -s at=0,90,65,100 frame=right
         if test -f $HISTFILEDIR/$GIS_OPT_MAP/histogram ; then
-    	     d.legend -n map=$GIS_OPT_MAP
+    	     d.legend $FLIP -n map=$GIS_OPT_MAP
         else
-             d.legend $OMIT map=$GIS_OPT_MAP
+             d.legend $FLIP $OMIT map=$GIS_OPT_MAP
         fi
 
        #draw map
@@ -126,9 +134,9 @@ else
        #draw legend
     	d.frame -s at=0,90,65,100 frame=right
         if test -f $HISTFILEDIR/$GIS_OPT_MAP/histogram ; then
-             d.legend -n map=$GIS_OPT_MAP lines=$GIS_OPT_NUM_OF_LINES
+             d.legend $FLIP -n map=$GIS_OPT_MAP lines=$GIS_OPT_NUM_OF_LINES
         else
-             d.legend $OMIT map=$GIS_OPT_MAP
+             d.legend $FLIP $OMIT map=$GIS_OPT_MAP
         fi
 
        #draw map

+ 2 - 1
scripts/d.rast.leg/d.rast.leg.html

@@ -9,7 +9,8 @@ frame remains active when the program finishs.
 
 <H2>NOTES</H2>
 
-
+The legend may be flipped with the <B>-f</B> flag.
+<P>
 If the <B>num_of_lines</B> parameter is not given then the legend frame will 
 display as many lines as number of categories in the map, otherwise, it 
 will display the first <B>num_of_lines</B> minus 1 categories with the