Explorar o código

added flip legend flap

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@33527 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler %!s(int64=16) %!d(string=hai) anos
pai
achega
9df7b5911a
Modificáronse 2 ficheiros con 17 adicións e 8 borrados
  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.
 # 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
 # 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
 # Markus Neteler 10/2003: added g.parser
 # Michael Barton 12/2004: remove reference to (null)
 # Michael Barton 12/2004: remove reference to (null)
 ##############################################################################
 ##############################################################################
@@ -40,9 +40,13 @@
 #%  keywords: display
 #%  keywords: display
 #%End
 #%End
 #%flag
 #%flag
+#%  key: f
+#%  description: Flip legend
+#%end
+#%flag
 #%  key: n
 #%  key: n
-#%  description: omit entries with missing label
-#%END
+#%  description: Omit entries with missing label
+#%end
 #%option
 #%option
 #% key: map
 #% key: map
 #% type: string
 #% type: string
@@ -70,6 +74,10 @@ if [ $GIS_FLAG_N -eq 1 ] ; then
   OMIT="-n"
   OMIT="-n"
 fi
 fi
 
 
+if [ $GIS_FLAG_F -eq 1 ] ; then
+  FLIP="-f"
+fi
+
 #for -n flag of d.legend
 #for -n flag of d.legend
 eval `g.findfile el=cell file=$GIS_OPT_MAP`
 eval `g.findfile el=cell file=$GIS_OPT_MAP`
 if [ ! "$file" ] ; then
 if [ ! "$file" ] ; then
@@ -103,9 +111,9 @@ then
        #draw legend
        #draw legend
     	d.frame -s at=0,90,65,100 frame=right
     	d.frame -s at=0,90,65,100 frame=right
         if test -f $HISTFILEDIR/$GIS_OPT_MAP/histogram ; then
         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
         else
-             d.legend $OMIT map=$GIS_OPT_MAP
+             d.legend $FLIP $OMIT map=$GIS_OPT_MAP
         fi
         fi
 
 
        #draw map
        #draw map
@@ -126,9 +134,9 @@ else
        #draw legend
        #draw legend
     	d.frame -s at=0,90,65,100 frame=right
     	d.frame -s at=0,90,65,100 frame=right
         if test -f $HISTFILEDIR/$GIS_OPT_MAP/histogram ; then
         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
         else
-             d.legend $OMIT map=$GIS_OPT_MAP
+             d.legend $FLIP $OMIT map=$GIS_OPT_MAP
         fi
         fi
 
 
        #draw map
        #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>
 <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 
 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 
 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
 will display the first <B>num_of_lines</B> minus 1 categories with the