7.3.3. pyafv.FiniteVoronoiSimulator.plot_2d

FiniteVoronoiSimulator.plot_2d(ax=None, show=False, **kw)[source]

Build the finite Voronoi structure and render a 2D snapshot. The plotting style follows scipy.spatial.voronoi_plot_2d().

This method is basically a wrapper of _build_voronoi_with_extensions() and _per_cell_geometry() functions + plot.

Parameters:
  • ax (Axes | None) – If provided, draw into the axes; otherwise get the current axes.

  • show (bool) – Whether to call plt.show() at the end.

  • show_points (bool, optional) – Add cell center points to the plot, default True.

  • point_size (float, optional) – Specifies the marker size for the points, default 2.

  • show_inner_vertices (bool, optional) – Add inner vertices to the plot, default False.

  • show_outer_vertices (bool, optional) – Add outer vertices to the plot, default False.

  • line_color_in (str, optional) – Specifies the color for contact edges (and inner vertices), default ‘b’.

  • line_color_out (str, optional) – Specifies the color for non-contact edges (and outer vertices), default ‘C6’.

  • line_width (float, optional) – Specifies the line width for cell boundaries, default 1.5.

  • line_alpha (float, optional) – Specifies the line alpha for cell boundaries, default 1.0.

  • show_voronoi (bool, optional) – Add the Voronoi edges to the plot, default True.

Returns:

The matplotlib axes containing the plot.

Return type:

Axes