d.northarrow
Displays a north arrow on the graphics monitor.
d.northarrow [-twr] [style=string] [at=x,y] [rotation=float] [label=string] [color=name] [fill_color=name] [text_color=name] [width=float] [font=string] [fontsize=float] [path=name] [charset=string] [--verbose] [--quiet] [--qq] [--ui]
Example:
d.northarrow
grass.script.run_command("d.northarrow", style="1a", at="85.0,15.0", rotation=0, label="N", color="black", fill_color="black", text_color=None, width=0, font=None, fontsize=14, path=None, charset=None, flags=None, verbose=False, quiet=False, superquiet=False)
Example:
gs.run_command("d.northarrow")
Parameters
style=string
North arrow style
Allowed values: 1a, 1b, 2, 3, 4, 5, 6, 7a, 7b, 8a, 8b, 9, fancy_compass, basic_compass, arrow1, arrow2, arrow3, star
Default: 1a
1a: Two color arrowhead
1b: Two color arrowhead with circle
2: Narrow with blending N
3: Long with small arrowhead
4: Inverted narrow inside a circle
5: Triangle and N inside a circle
6: Arrowhead and N inside a circle
7a: Tall half convex arrowhead
7b: Tall half concave arrowhead
8a: Thin arrow in a circle
8b: Fat arrow in a circle
9: One color arrowhead
fancy_compass: Fancy compass
basic_compass: Basic compass
arrow1: Simple arrow
arrow2: Thin arrow
arrow3: Fat arrow
star: 4-point star
at=x,y
Screen coordinates of the rectangle's top-left corner
(0,0) is lower-left of the display frame
Allowed values: 0-100
Default: 85.0,15.0
rotation=float
Rotation angle in degrees (counter-clockwise)
Default: 0
label=string
Displayed letter on the top of arrow
Default: N
color=name
Line color
Either a standard color name, R:G:B triplet, or "none"
Default: black
fill_color=name
Fill color
Either a standard color name, R:G:B triplet, or "none"
Default: black
text_color=name
Text color
Either a standard color name or R:G:B triplet
width=float
Line width
Default: 0
font=string
Font name
fontsize=float
Font size
Allowed values: 1-360
Default: 14
path=name
Path to font file
charset=string
Text encoding (only applicable to TrueType fonts)
-t
Draw the symbol without text
-w
Do not rotate text with symbol
-r
Use radians instead of degrees for rotation
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--qq
Very quiet module output
--ui
Force launching GUI dialog
style : str, optional
North arrow style
Used as: input, northarrow
Allowed values: 1a, 1b, 2, 3, 4, 5, 6, 7a, 7b, 8a, 8b, 9, fancy_compass, basic_compass, arrow1, arrow2, arrow3, star
1a: Two color arrowhead
1b: Two color arrowhead with circle
2: Narrow with blending N
3: Long with small arrowhead
4: Inverted narrow inside a circle
5: Triangle and N inside a circle
6: Arrowhead and N inside a circle
7a: Tall half convex arrowhead
7b: Tall half concave arrowhead
8a: Thin arrow in a circle
8b: Fat arrow in a circle
9: One color arrowhead
fancy_compass: Fancy compass
basic_compass: Basic compass
arrow1: Simple arrow
arrow2: Thin arrow
arrow3: Fat arrow
star: 4-point star
Default: 1a
at : tuple[float, float] | list[float] | str, optional
Screen coordinates of the rectangle's top-left corner
(0,0) is lower-left of the display frame
Used as: x,y
Allowed values: 0-100
Default: 85.0,15.0
rotation : float, optional
Rotation angle in degrees (counter-clockwise)
Default: 0
label : str, optional
Displayed letter on the top of arrow
Default: N
color : str, optional
Line color
Either a standard color name, R:G:B triplet, or "none"
Used as: input, color, name
Default: black
fill_color : str, optional
Fill color
Either a standard color name, R:G:B triplet, or "none"
Used as: input, color, name
Default: black
text_color : str, optional
Text color
Either a standard color name or R:G:B triplet
Used as: input, color, name
width : float, optional
Line width
Default: 0
font : str, optional
Font name
fontsize : float, optional
Font size
Allowed values: 1-360
Default: 14
path : str, optional
Path to font file
Used as: input, file, name
charset : str, optional
Text encoding (only applicable to TrueType fonts)
flags : str, optional
Allowed values: t, w, r
t
Draw the symbol without text
w
Do not rotate text with symbol
r
Use radians instead of degrees for rotation
verbose: bool, optional
Verbose module output
Default: False
quiet: bool, optional
Quiet module output
Default: False
superquiet: bool, optional
Very quiet module output
Default: False
DESCRIPTION
d.northarrow displays a north arrow symbol at the given screen coordinates. If no coordinates are given it will draw the north arrow in the bottom right of the display. It can draw the north arrow in a number of styles (see the wiki page for details). With certain styles of north arrow label 'N' is displayed by default, and can be changed with option label, for example for different languages. The label can be hidden with -t flag.
North arrow can be rotated, for example to align with true north, not grid north. The angle in degrees counter-clockwise (or radians with -r flag) can be specified with option rotation. Label is rotated together with the arrow, unless flag -w is specified.
EXAMPLES
Display a north arrow symbol as a basic compas with label NORTH, rotated by 8 degrees with label, with black line and gray fill:
d.mon wx0
d.northarrow style=basic_compas rotation=8 label=NORTH -w color=black fill_color=gray
d.mon -r
SEE ALSO
d.barscale, d.graph, d.grid, d.legend
AUTHORS
Hamish Bowman, Department of Geology, University of Otago, New
Zealand
Improvements as part of GSoC 2016 by Adam Laza, CTU in Prague
SOURCE CODE
Available at: d.northarrow source code
(history)
Latest change: Tuesday Feb 11 14:24:00 2025 in commit bd67b98