pygmt.Figure.magnetic_rose
- Figure.magnetic_rose(position=None, width=None, labels=False, outer_pen=False, inner_pen=False, declination=None, declination_label=None, intervals=None, box=False, perspective=False, verbose=False, transparency=None)
Add a magnetic rose to the map.
- Parameters:
position (
Position|None, default:None) – Specify the location of the magnetic rose on a map. Seepygmt.params.Positionfor details.width (
float|str|None, default:None) – Width of the rose in plot coordinates (append i (inch), cm (centimeters), or p (points)), or append % for a size in percentage of map width [Default is 15 %].labels (
Sequence[str] |bool, default:False) – A sequence of four strings to label the cardinal points W,E,S,N. Use an empty string to skip a specific label. If the north label is"*", then a north star is plotted instead of the north label. If set toTrue, use the default labels["W", "E", "S", "N"].outer_pen (
str|bool, default:False) – Draw the outer circle of the magnetic rose, using the given pen attributes.inner_pen (
str|bool, default:False) – Draw the inner circle of the magnetic rose, using the given pen attributes.declination (
float|None, default:None) – Magnetic declination in degrees. By default, only a geographic north is plotted. With this parameter set, a magnetic north is also plotted. A magnetic compass needle is drawn inside the rose to indicate the direction to magnetic north.declination_label (
str|None, default:None) – Label for the magnetic compass needle. Default is to format a label based on declination. To bypass the label, set to"-".intervals (
Sequence[float] |None, default:None) – Specify the annotation and tick intervals for the geographic and magnetic directions. It can be a seqeunce of three or six values. If three values are given, they are used for both geographic and magnetic directions. If six values are given, the first three are used for geographic directions and the last three for magnetic directions. Default is(30, 5, 1). Note: If MAP_EMBELLISHMENT_MODE is"auto"and the compass size is smaller than 2.5 cm then the interval defaults are reset to(90,30, 3, 45, 15, 3).box (
Box|bool, default:False) – Draw a background box behind the magnetic rose. If set toTrue, a simple rectangular box is drawn using MAP_FRAME_PEN. To customize the box appearance, pass apygmt.params.Boxobject to control style, fill, pen, and other box properties.$perspective
$verbose
$transparency
Examples
>>> import pygmt >>> from pygmt.params import Position >>> fig = pygmt.Figure() >>> fig.basemap(region=[-10, 10, -10, 10], projection="M15c", frame=True) >>> fig.magnetic_rose( ... position=Position((-5, -5), cstype="mapcoords"), ... width="4c", ... labels=["W", "E", "S", "*"], ... intervals=(45, 15, 3, 60, 20, 4), ... outer_pen="1p,red", ... inner_pen="1p,blue", ... declination=11.5, ... declination_label="11.5°E", ... ) >>> fig.show()