1d.legend.vect(1)            GRASS GIS User's Manual           d.legend.vect(1)
2
3
4

NAME

6       d.legend.vect  - Displays a vector legend in the active graphics frame.
7

KEYWORDS

9       display, cartography, vector, legend
10

SYNOPSIS

12       d.legend.vect
13       d.legend.vect --help
14       d.legend.vect  [-b]  [at=left,top]   [columns=integer]   [title=string]
15       [symbol_size=integer]    [border_color=name]    [bgcolor=name]    [bor‐
16       der_width=integer]            [font=string]            [fontsize=float]
17       [title_font=string]      [title_fontsize=float]       [sub_font=string]
18       [sub_fontsize=float]       [fontcolor=name]       [separator=character]
19       [input=name]    [output=name]    [--overwrite]   [--help]   [--verbose]
20       [--quiet]  [--ui]
21
22   Flags:
23       -b
24           Display legend background
25
26       --overwrite
27           Allow output files to overwrite existing files
28
29       --help
30           Print usage summary
31
32       --verbose
33           Verbose module output
34
35       --quiet
36           Quiet module output
37
38       --ui
39           Force launching GUI dialog
40
41   Parameters:
42       at=left,top
43           Screen  position  of legend to be drawn (percentage, [0,0] is lower
44           left)
45           Options: 0-100
46           Default: 10,40
47
48       columns=integer
49           Number of legend columns
50           Default: 1
51
52       title=string
53           Legend title
54
55       symbol_size=integer
56           Symbol size
57           Default: 20
58
59       border_color=name
60           Border color
61           Either a standard color name, R:G:B triplet, or "none"
62           Default: black
63
64       bgcolor=name
65           Background color
66           Either a standard color name, R:G:B triplet, or "none"
67           Default: white
68
69       border_width=integer
70           Background border width
71           Default: 2
72
73       font=string
74           Font name
75
76       fontsize=float
77           Font size
78           Default: 12
79           Options: 1-360
80
81       title_font=string
82           Title font name
83
84       title_fontsize=float
85           Title font size
86           Default: 18
87           Options: 1-360
88
89       sub_font=string
90           Subtitle font name
91
92       sub_fontsize=float
93           Subtitle font size
94           Default: 14
95           Options: 1-360
96
97       fontcolor=name
98           Font color
99           Either a standard color name or R:G:B triplet
100           Default: black
101
102       separator=character
103           Field separator for input file
104           Special characters: pipe, comma, space, tab, newline
105           Default: pipe
106
107       input=name
108           Input legend file
109           Path to legend file
110
111       output=name
112           Output csv file
113           Path to output file or ’-’ for standard output
114

DESCRIPTION

116       Module d.legend.vect draws vector legend of currently displayed  vector
117       maps.
118
119       Parameter  at  defines the screen position of upper-left legend corner.
120       Parameter columns defines the number of legend columns.  User can spec‐
121       ify a title of the legend using parameter title.  The font of the title
122       can be changed with title_font, title_fontsize.  Flag  -b  is  used  to
123       draw  background  of specified color (bgcolor), border color and border
124       width (border_color and border_width).  Parameter  symbol_size  defines
125       the  size of line and area symbols.  The size of point symbols is based
126       on currently set symbology of vector maps using d.vect  or  d.vect.the‐
127       matic.
128
129       Module  d.vect.legend  supports  subtitles  (see section Notes).  Their
130       font and font size can be set using parameters sub_font  and  sub_font‐
131       size.
132
133   Changing legend symbols and labels
134       Symbols  for  vector  areas and lines, and labels for individual vector
135       labels can be changed in the symbology setting of each  vector  map  in
136       d.vect  or  d.vect.thematic  module (in Legend tab). Use its parameters
137       icon_area and icon_line to  pick  from  available  symbols.   By  using
138       parameter  legend_label  of d.vect module, users can change the default
139       label, which is the map name.
140
141   Modifying the order of legend entries and omitting certain vector maps
142       from legend Modules d.vect and d.vect.thematic have  a  flag  -s  which
143       removes the particular vector or thematic vector from vector legend.
144
145       The  order of entries is defined by the order in Layer Manager (if used
146       in GRASS GIS GUI). If that’s not desired, one  can  export  the  legend
147       file  into  a  text  file  using  parameter output, change the order of
148       entries (see section Notes for format description) and then upload  the
149       modified  file  with parameter input.  Parameter output defines path to
150       the file where the internal legend file will be saved to, input defines
151       the  input  file  which  the vector legend will be based on (input file
152       must have correct format).
153

NOTES

155       Module d.legend.vect draws vector legend based on legend  file  defined
156       in shell environment variable GRASS_LEGEND_FILE.  This file is automat‐
157       ically created and updated whenever d.vect command is used.   User  can
158       create   custom   legend   file   and   then   use   export  GRASS_LEG‐
159       END_FILE=path/to/file in shell.  GRASS GUI and MONITORS create the leg‐
160       end file automatically.  By default the legend file is stored in grass‐
161       data/location/mapset/.tmp/user directory (in case of  d.mon  deeper  in
162       /monitor_name directory).
163
164       Legend file has this format:
165       label|symbol_name|size|color_type|feature_color|fill_color|line_width|geometry_type|feature_count
166       Color  type  can be ’lf’ or ’ps’. Based on color type color columns are
167       interpreted as line color and fill colors (lf),  or  primary  and  sec‐
168       ondary colors (ps).  Module d.vect always uses ’lf’ and d.vect.thematic
169       ’ps’.  Here is an example of legend file with subtitles:
170       Infrastructure||||||||
171       major roads|legend/line|5|lf|black|200:200:200|2|line|355
172       bridges|extra/bridge|15|lf|black|black|1|point|10938
173       Hydrology||||||||
174       streams|legend/line_crooked|5|lf|30:144:255|200:200:200|3|line|8554
175       water bodies|legend/area_curved|5|lf|none|30:144:255|1|area|27764
176

EXAMPLES

178       Open cairo monitor to render to file:
179       g.region vector=nc_state
180       d.mon cairo
181       d.vect map=nc_state color=26:26:26 fill_color=229:229:229 width=2 legend_label="state boundaries"
182       d.vect map=urbanarea color=none fill_color=127:127:127 width=1 legend_label="urban areas"
183       d.vect map=railroads color=red width=1
184       d.vect map=hospitals color=77:77:77 fill_color=0:187:0 width=1 icon=basic/cross3 size=10
185       d.legend.vect -b at=2,40 title="Hospitals in North Carolina" symbol_size=26 fontsize=16 title_fontsize=20
186

SEE ALSO

188        d.vect, d.vect.thematic, d.legend
189
190       Check also Python module from AddOns: d.vect.thematic2
191

AUTHOR

193       Adam Laza, during GSoC 2016 Mentors:  Anna  Petrasova,  Vaclav  Petras,
194       Martin Landa
195

SOURCE CODE

197       Available at: d.legend.vect source code (history)
198
199       Main  index | Display index | Topics index | Keywords index | Graphical
200       index | Full index
201
202       © 2003-2020 GRASS Development Team, GRASS GIS 7.8.5 Reference Manual
203
204
205
206GRASS 7.8.5                                                   d.legend.vect(1)
Impressum