sgio.plot_sg_2d_plotly#
- sgio.plot_sg_2d_plotly(sg, mesh_style: str = 'regions', mesh_color: str = 'rgba(30,30,30,0.9)', mesh_width: float = 1.5, show_origin: bool = True, fig=None, output_html: str | Path | None = None, title: str = '')#
Plot the mesh of a single 2D cross-section using plotly.
Plotly counterpart of
plot_sg_2d(). Renders only the section geometry (mesh as a region outline or full wireframe, plus an optional origin marker). The constitutive-model overlays are drawn separately byplot_model_2d_plotly(); pass its returnedfigbetween the two (or the samefig) to combine them.- Parameters:
sg (StructureGene) – The 2D structure gene to plot; must have a
meshattribute.mesh_style ({'regions', 'boundary', 'wireframe'}, optional) – Mesh rendering style; see
_extract_section_edges(). Default'regions'.mesh_color (str, optional) – Color string for mesh lines (plotly notation).
mesh_width (float, optional) – Mesh line width in pixels. Default 1.5.
show_origin (bool, optional) – Whether to mark the section origin (0, 0). Default True.
fig (plotly.graph_objects.Figure, optional) – Existing figure to add the mesh traces to. If
Nonea new figure is created. DefaultNone.output_html (str or Path, optional) – If given, the figure is written to this HTML file.
title (str, optional) – Optional figure title (used only when creating a new figure).
- Returns:
The figure the mesh was added to.
- Return type:
plotly.graph_objects.Figure