doc_utils

gridkit.doc_utils.generate_2d_scatter_doughnut(num_points: float, radius: float) ndarray[source]

Generate a 2d doughnut shape of points distributed using gaussian noise.

Parameters:
  • num_points (float) – The total number of points that make up the doughnut shape.

  • radius (float) – The radius of the circle around which the points are scattered

Returns:

The points that make up the doughnut shape

Return type:

numpy.ndarray

gridkit.doc_utils.plot_polygons(geoms: ~typing.List[~shapely.geometry.polygon.Polygon], colors: ~numpy.ndarray | str | None = None, cmap: str = 'viridis', filled: bool = True, ax=<module 'matplotlib.pyplot' from '/tmp/gridkit_docs/v0.7.3/venv/lib/python3.10/site-packages/matplotlib/pyplot.py'>, **kwargs)[source]

Plot polygons on a map and color them based on the supplied values

Parameters:
  • geoms (List[shapely.Polygon]) – A list of shapely polygons to draw

  • colors (Union[numpy.ndarray, str]) – If a string is supplied, the string is assumed to be the name of a matplotlib color, e.g. ‘green’. If colors is a numpy array or a list, these values will be used to color the supplied geoms according the the supplied cmap. If None, the all polygons will be black.

  • cmap (str) – The matplitlib complient colormap name to use Will be ignored if the ‘values’ argument not is supplied.

  • filled (bool) – Whether only the outline of the polygon should be drawn (False) or the polygon should be filled (True)

  • ax (matplotlib.axes.Axes (optional)) – The matplotlib axis object to plot on. If an axis object is supplied, the plot will be edited in-place. Default: matplotlib.pyplot

Return type:

None