Visualizer Module¶
Visualization tool.
This module provides:
visualize: Visualize the GraphState.
- class graphqomb.visualizer.FigureSetup[source]¶
Parameters for setting up the figure.
- static __new__(_cls, x_min, x_max, y_min, y_max, padding, fig_width, fig_height)¶
Create new instance of FigureSetup(x_min, x_max, y_min, y_max, padding, fig_width, fig_height)
- graphqomb.visualizer.visualize(graph, *, ax=None, show_node_labels=True, node_size=300, show_legend=True, use_graph_coordinates=True)[source]¶
Visualize the GraphState.
- Parameters:
graph (
BaseGraphState) – GraphState to visualize.ax (
matplotlib.axes.Axes| None, optional) – Matplotlib Axes to draw on, by default Noneshow_node_labels (
bool, optional) – Whether to show node index labels, by default Truenode_size (
float, optional) – Size of nodes (scatter size), by default 300show_legend (
bool, optional) – Whether to show color legend, by default Trueuse_graph_coordinates (
bool, optional) – Whether to use coordinates stored in the graph. If True and the graph has coordinates, those coordinates are used (projected to 2D for 3D coordinates). Nodes without coordinates will use auto-calculated positions. By default True.
- Returns:
The Axes object containing the visualization
- Return type:
Notes
Currently only 2D visualization is supported. For 3D coordinates, only the x and y components are used; the z component is ignored. 3D visualization support is planned for a future release.