oneworld.StaticMap.add_txt

StaticMap.add_txt(latitude, longitude, text, data=None, x_offset=10, y_offset=10, crs='Geodetic', box_kwargs=None, **kwargs)

Add text to the map.

Given a set of coordinates and text, put said text in the map at a small offset of the coordinates. The reason behind the offset is that you can supply the coordinates of a named place, and plot text regarding that point in the map without the point covering the point itself. That offset can be nullified if desired.

Parameters:
  • latitude (list or tuple or str) – Sequence (list or tuple) or name of the column of the dataframe in data containing the longitude coordinate for the center of each circle.

  • longitude (list or tuple or str) – Sequence (list or tuple) or name of the column of the dataframe in data containing the latitude coordinate for the center of each circle.

  • text (list or tuple or str) – Sequence (list or tuple) or name of the column of the dataframe in data containing the text to be displayed.

  • data (pandas DataFrame) – Dataframe containing one or more columns of values to use. Each row must contain the data for a circle, with columns as the data to be used (Default: None).

  • x_offset (int) – Offset of the text with regard to the longitude value provided in the longitude parameter, in pixels (Default: 10).

  • y_offset (int) – Offset of the text with regard to the latitude value provided in the latitude parameter, in pixels (Default: 10).

  • crs (str) – Coordinate reference system on which latitude and longitude are specified. See https://scitools.org.uk/cartopy/docs/latest/crs/index.html for a full list of supported crs (Default: ‘Geodetic’)

  • box_kwargs (dict or None) – Extra keyword arguments for the text box. See https://matplotlib.org/3.2.1/api/_as_gen/matplotlib.patches.FancyBboxPatch.html for a list of supported arguments (Default: None)

  • **kwargs – Extra arguments for the text plotting function. See https://matplotlib.org/3.2.1/api/text_api.html#matplotlib.text.Text for a list of supported arguments.