spateo.plotting.static.bbs#

Plotting functions for creating the bounding box.

Module Contents#

Functions#

polygon(concave_hull, shapely.geometry.Polygon], ...)

Plot the polygon identified by the alpha hull method.

delaunay(edge_points, figsize, List] =, pc, title, ...)

Plot the Delaunay triangulation result.

spateo.plotting.static.bbs.polygon(concave_hull: Union[shapely.geometry.MultiPolygon, shapely.geometry.Polygon], figsize: Union[Tuple, List] = (10, 10), margin: float = 0.3, fc: str = '#999999', ec: str = '#000000', fig: Optional[matplotlib.figure.Figure] = None, ax: Optional[matplotlib.axes.Axes] = None, background: Optional[str] = None, save_show_or_return: typing_extensions.Literal[save, show, return, both, all] = 'show', save_kwargs: Optional[Dict] = None)[source]#

Plot the polygon identified by the alpha hull method.

Parameters:
concave_hull

The identified polygon (or multi-polygon) returned from the alpha_shape method or other methods.

figsize

The size of the figure

margin

The margin of the figure Axes.

fc

The facecolor of the PolygonPatch.

ec

The edgecolor of the PolygonPatch.

background

string or None (optional, default ‘None`) The color of the background. Usually this will be either ‘white’ or ‘black’, but any color name will work. Ideally one wants to match this appropriately to the colors being used for points etc. This is one of the things that themes handle for you. Note that if theme is passed then this value will be overridden by the corresponding option of the theme.

save_show_or_return

Whether to save, show or return the figure. If “both”, it will save and plot the figure at the same time. If “all”, the figure will be saved, displayed and the associated axis and other object will be return.

save_kwargs

A dictionary that will passed to the save_fig function. By default it is an empty dictionary and the save_fig function will use the {“path”: None, “prefix”: ‘scatter’, “dpi”: None, “ext”: ‘pdf’, “transparent”: True, “close”: True, “verbose”: True} as its parameters. Otherwise you can provide a dictionary that properly modify those keys according to your needs.

Returns:

The matplotlib.figure figure object of the figure. ax: The matplotlib.axes._subplots AxesSubplot object of the figure.

Return type:

fig

spateo.plotting.static.bbs.delaunay(edge_points, figsize: Union[Tuple, List] = (10, 10), pc: str = '#f16824', title: Optional[str] = None, fig: Optional[matplotlib.figure.Figure] = None, ax: Optional[matplotlib.axes.Axes] = None, background: Optional[str] = None, save_show_or_return: typing_extensions.Literal[save, show, return, both, all] = 'show', save_kwargs: Optional[Dict] = None)[source]#

Plot the Delaunay triangulation result.

Parameters:
edge_points

figsize

The size of the figure

fc

The color of the scatter points.

title

The title of the figure.

fig

The matplotlib.figure figure object of the figure.

ax

The matplotlib.axes._subplots AxesSubplot object of the figure.

background

string or None (optional, default ‘None`) The color of the background. Usually this will be either ‘white’ or ‘black’, but any color name will work. Ideally one wants to match this appropriately to the colors being used for points etc. This is one of the things that themes handle for you. Note that if theme is passed then this value will be overridden by the corresponding option of the theme.

save_show_or_return

Whether to save, show or return the figure. If “both”, it will save and plot the figure at the same time. If “all”, the figure will be saved, displayed and the associated axis and other object will be return.

save_kwargs

A dictionary that will passed to the save_fig function. By default it is an empty dictionary and the save_fig function will use the {“path”: None, “prefix”: ‘scatter’, “dpi”: None, “ext”: ‘pdf’, “transparent”: True, “close”: True, “verbose”: True} as its parameters. Otherwise you can provide a dictionary that properly modify those keys according to your needs.

Returns:

The matplotlib.figure figure object of the figure. ax: The matplotlib.axes._subplots AxesSubplot object of the figure.

Return type:

fig