neural_lam.plot_graph#

Command-line utility for plotting saved Neural-LAM graphs.

Attributes#

Functions#

main(→ None)

Plot graph structure in 3D using plotly.

plot_graph(→ plotly.graph_objects.Figure)

Build a 3D plotly figure of the graph structure.

Module Contents#

neural_lam.plot_graph.main() → None[source]#

Plot graph structure in 3D using plotly.

neural_lam.plot_graph.plot_graph(grid_pos: numpy.ndarray, hierarchical: bool, graph_ldict: dict[str, Any], show_axis: bool = False, save: str | None = None) → plotly.graph_objects.Figure[source]#

Build a 3D plotly figure of the graph structure.

Parameters:
  • grid_pos (np.ndarray) – Grid node positions, shape (num_grid_nodes, 2).

  • hierarchical (bool) – Whether the loaded graph is hierarchical.

  • graph_ldict (dict) – Graph dict as returned by utils.load_graph.

  • show_axis (bool) – If True, show the 3D axis.

  • save (str or None) – If given, save the figure as an HTML file at this path.

Returns:

The plotly figure object.

Return type:

go.Figure

neural_lam.plot_graph.GRID_HEIGHT = 0#
neural_lam.plot_graph.MESH_HEIGHT = 0.1#
neural_lam.plot_graph.MESH_LEVEL_DIST = 0.2#