d.legend.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <h2>DESCRIPTION</h2>
  2. <em>d.legend</em> displays a legend for a user-specified
  3. raster map layer in the active frame on the graphics
  4. monitor.
  5. <p>
  6. The user can run <em>d.legend</em> either non-interactively
  7. or interactively. If the user specifies the name of a
  8. raster <b>map</b> layer on the command line, the program
  9. will run non-interactively. Default legend text
  10. <b>color</b> and position will be used unless
  11. the user specifies other values on the command line.
  12. <p>
  13. Alternately, the user can simply type <b>d.legend</b> on the command line;
  14. in this case, the program will prompt the user for parameter values
  15. using the standard GRASS GUI interface.
  16. <h2>NOTES</h2>
  17. The legend's default size is based on the dimensions of the
  18. active frame, specifically its height. <em>d.legend</em> will only
  19. obscure those portions of the active frame that directly underlie the legend.
  20. <p>When using the mouse or <b>at</b> to size &amp; place the legend, a user may
  21. create a horizontal legend by making the box wider than it is tall.
  22. <p>Raster maps based on floating point values will display smoothed, from greatest
  23. to smallest value, while categorial raster maps will display in order, from
  24. top to bottom. Horizontal legends will always be smoothed. If the box is defined
  25. with inverted y-values or an inverted <b>range</b>, the legend will automatically
  26. flip. If this is not the desired result, the <b>-f</b> flag may be used to flip
  27. it back.
  28. <p>If the user attempts to display a very long legend in a relatively short
  29. display frame, the legend may appear in unreadably small text, or even revert
  30. to a smooth gradient legend. Use the <b>lines</b>, <b>thin</b>, <b>use</b>, <b>range</b>,
  31. and/or <b>-n</b> options to reduce the number of categories to be displayed,
  32. or the <b>-s</b> flag to force a smooth gradient legend.
  33. Additionally the fonts for smoothed floating point legends
  34. can be scaled by a scale factor <b>fontscale</b>, to adjust the automatically computed size of the legend font.
  35. <p>The <b>lines</b> option will display the first number of categories, as defined
  36. by <em>value</em>, contained in the raster map. When used with the <b>-n</b> flag,
  37. it takes on a new meaning: "up to category #". When used with both
  38. <b>thin</b> and the <b>-n</b> flag, its meaning becomes more obscure. When
  39. using <b>lines</b>, auto-scaled text similar to "4 of 16 categories" will be placed at
  40. the bottom of the legend.
  41. <p>The <b>thin</b> option sets the thinning factor. For raster maps with a 0th
  42. category, <b>thin=</b><em>10</em> gives cats [0,10,20,...]. For raster maps
  43. starting at category 1, <b>thin=</b><em>10</em> gives cats [1,11,21,...].
  44. <p>The <b>use</b> option lets the user create a legend made up of arbitrary category
  45. values. e.g.&nbsp;<b>use=</b><em>1000,100,10,0,-10,-100,-1000</em>
  46. <p>The <b>range</b> option lets the user define the minimum and maximum categories
  47. to be used in the legend. It may also be used to define the limits of a smooth
  48. gradient legend created from a raster containing floating point values. Note
  49. the color scale will remain faithful to the category values as defined with
  50. <em><a href="r.colors.html">r.colors</a></em>, and the <b>range</b> may be
  51. extended to the limits defined by the <em><a href="r.colors.html">r.colors</a></em>
  52. color map.
  53. <p>The flag <b>-n</b> is useful for categorial maps, as it suppresses the
  54. drawing of non-existing categories (otherwise the full range is shown).
  55. <p>Vertical legends produced with <em>d.legend</em> will place text labels to the
  56. right of the legend box, horizontal legends will place text below. This text
  57. will be auto-scaled to fit within the frame, reducing the size of the legend
  58. if necessary. Legends positioned with the mouse or with the <b>at</b> option
  59. will not auto-scale text, in order to provide more control to the user.
  60. Smaller text may be obtained in this case by reducing the
  61. height of the box. The <b>-c</b> and <b>-v</b> flags may be used to suppress the
  62. display of category numbers and labels respectively, or used together to
  63. suppress all text of categorial raster maps.
  64. <p>The text produced from floating-point raster maps will automatically create
  65. output with a meaningful number of significant digits. For very small values,
  66. numbers will be expressed in scientific notation, e.g.&nbsp;"1.7e-9".
  67. <p>Legends placed with the mouse are not saved to the display window's history
  68. for automatic redraw. By setting the Debug level to 1 (see
  69. <em><a href="g.gisenv.html">g.gisenv</a></em>) the corresponding <b>at</b>
  70. setting can be determined.
  71. <p>Note that old scripts which relied on setting <b>lines</b> greater than the
  72. number of categories to scale the legend may no longer produce the desired
  73. output, although the auto-scaling should still produce something that looks
  74. good in this case.
  75. <h2>SEE ALSO</h2>
  76. <em>
  77. <a href="d.barscale.html">d.barscale</a>,
  78. <a href="d.colortable.html">d.colortable</a>,
  79. <a href="d.erase.html">d.erase</a>,
  80. <a href="d.font.html">d.font</a>,
  81. <a href="d.grid.html">d.grid</a>,
  82. <a href="d.rast.html">d.rast</a>,
  83. <!-- <a href="d.rast.labels.html">d.rast.labels</a>, -->
  84. <a href="d.rast.leg.html">d.rast.leg</a>,
  85. <a href="d.text.html">d.text</a>,
  86. <a href="d.vect.thematic.html">d.vect.thematic</a>,
  87. <!--<a href="d.what.rast.html">d.what.rast</a>,-->
  88. <a href="r.reclass.html">r.reclass</a>
  89. </em>
  90. <h2>AUTHORS</h2>
  91. Bill Brown, U.S. Army Construction Engineering Research Laboratories
  92. <br>Late 2002: Rewrite of much of the code. Hamish Bowman,
  93. Otago University, New Zealand
  94. <br>Additional improvements from various authors
  95. <p>
  96. <i>Last changed: $Date$</i>