add_markerο
- MapsGrid.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)ο
This will execute the corresponding action on ALL Maps objects of the MapsGrid!
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")