add_marker

Maps.add_marker(ID=None, xy=None, xy_crs=None, radius=None, radius_crs=None, shape='ellipses', buffer=1, n=100, layer=None, update=True, **kwargs)

Add a marker to the plot.

Parameters:
  • ID (any) – The index-value of the pixel in m.data.

  • xy (tuple) – A tuple of the position of the pixel provided in β€œxy_crs”. If β€œxy_crs” is None, xy must be provided in the plot-crs! The default is None

  • xy_crs (any) – the identifier of the coordinate-system for the xy-coordinates

  • radius (float or "pixel", optional) –

    • If float: The radius of the marker.

    • If β€œpixel”: It will represent the dimensions of the selected pixel. (check the buffer kwarg!)

    The default is None in which case β€œpixel” is used if a dataset is present and otherwise a shape with 1/10 of the axis-size is plotted

  • radius_crs (str or a crs-specification) – The crs specification in which the radius is provided. Either β€œin”, β€œout”, or a crs specification (e.g. an epsg-code, a PROJ or wkt string …) The default is β€œin” (e.g. the crs specified via m.data_specs.crs). (only relevant if radius is NOT specified as β€œpixel”)

  • shape (str, optional) –

    Indicator which shape to draw. Currently supported shapes are: - geod_circles - ellipses - rectangles

    The default is β€œcircle”.

  • buffer (float, optional) – A factor to scale the size of the shape. The default is 1.

  • n (int) – The number of points to calculate for the shape. The default is 100.

  • layer (str, int or None) – The name of the layer at which the marker should be drawn. If None, the layer associated with the used Maps-object (e.g. m.layer) is used. The default is None.

  • kwargs – kwargs passed to the matplotlib patch. (e.g. zorder, facecolor, edgecolor, linewidth, alpha etc.)

  • update (bool, optional) – If True, call m.BM.update() to immediately show dynamic annotations If False, dynamic annotations will only be shown at the next update

Examples

>>> m.add_marker(ID=1, buffer=5)
>>> m.add_marker(ID=1, radius=2, radius_crs=4326, shape="rectangles")
>>> m.add_marker(xy=(4, 3), xy_crs=4326, radius=20000, shape="geod_circles")