optiwindnet.plotting ==================== .. py:module:: optiwindnet.plotting Module Contents --------------- .. py:function:: gplot(G: networkx.Graph, ax: matplotlib.axes.Axes | None = None, node_tag: str | bool | None = None, landscape: bool = True, infobox: bool = True, scalebar: tuple[float, str] | None = None, hide_ST: bool = True, legend: bool = False, min_dpi: int = 192, dark: bool | None = None, tag_border: bool = False, **kwargs) -> matplotlib.axes.Axes Plot site and routeset contained in G. This function relies on matplotlib and networkx's drawing functions. If no Axes instance is provided, a Figure with a single Axes will be created. Extra arguments given to gplot() will be forwarded to Figure(). :param ax: Axes instance to plot into. If `None`, opens a new figure. :param node_tag: text tag inside each node (e.g. 'load', 'label' or any of the nodes' attributes). If `True`, tags the nodes with their numbers. :param tag_border: if True, all border and obstacle vertices get a number tag. :param landscape: True -> rotate the plot by G's attribute 'landscape_angle'. :param infobox: Draw text box with summary of G's main properties: capacity, number of turbines, number of feeders, total cable length. :param scalebar: (span_in_data_units, label) add a small bar to indicate the plotted features' scale (lower right corner). :param hide_ST: If coordinates include a Delaunay supertriangle, adjust the viewport to fit only the actual vertices (i.e. no ST vertices). :param legend: Add description of linestyles and node shapes. :param min_dpi: Minimum dots per inch to use. matplotlib's default is used if it is greater than this value. :param \*\*kwargs: passed on to matplotlib's Figure() :returns: Axes instance containing the plot. .. py:function:: pplot(P: networkx.PlanarEmbedding, A: networkx.Graph, **kwargs) -> matplotlib.axes.Axes Plot PlanarEmbedding `P` using coordinates from `A`. Wrapper for `.plotting.gplot()`. Performs what one would expect from `gplot(P, ...)` - which does not work because P lacks coordinates and node 'kind' attribute. The source needs to be `A` (as opposed to `G` or `L`) because only `A` has the supertriangle's vertices coordinates. :param P: Planar embedding to plot. :param A: source of vertex coordinates and 'kind'. :returns: Axes instance containing the plot.