add_compass

Maps.add_compass(pos=None, scale=10, style='compass', patch=None, txt='N', pickable=True, layer='all', ignore_invalid_angles=False)

Add a “compass” or “north-arrow” to the map.

Note

You can use the mouse to pick the compass and move it anywhere on the map. (the directions are dynamically updated if you pan/zoom or pick the compass)

  • If you press the “delete” key while clicking on the compass, it is removed. (same as calling compass.remove())

  • If you press the “d” key while clicking on the compass, it will be disconnected from pick-events (same as calling compass.set_pickable(False))

Parameters
  • pos (tuple or None, optional) – The relative position of the compass with respect to the axis. (0,0) - lower left corner, (1,1) - upper right corner Note that you can also move the compass with the mouse!

  • scale (float, optional) – A scale-factor for the size of the compass. The default is 10.

  • style (str, optional) –

    • “north arrow” : draw only a north-arrow

    • ”compass”: draw a compass with arrows in all 4 directions

    The default is “compass”.

  • patch (False, str or tuple, optional) – The color of the background-patch. (can be any color specification supported by matplotlib) The default is “w”.

  • txt (str, optional) – Indicator which directions should be indicated. - “NESW” : add letters for all 4 directions - “NE” : add only letters for North and East (same for other combinations) - None : don’t add any letters The default is “N”.

  • pickable (bool, optional) – Indicator if the compass should be static (False) or if it can be dragged with the mouse (True). The default is True

  • layer (str, optional) – The layer to put the compass on. The default is “all”.

  • ignore_invalid_angles (bool, optional) –

    • If True the compass will always (silently) use the last valid rotation-angle in case the correct angle could not be determined.

    • If False, a warning will be issued in case the angle could not be determined, and a red border will be drawn around the compass to indicate that it might not point in the right direction.

    The default is False

Returns

compass – A compass-object that can be used to manually adjust the style and position of the compass or remove it from the map.

Return type

eomaps.Compass