pycba.plotting#

PyCBA - optional Plotly plotting backend.

Interactive, hover-to-read versions of the result diagrams and envelopes. Hovering over a curve reads the value at that section; with the shared x-axis of the combined plots, one hover reports the bending moment, shear and deflection at the same position.

Plotly is an optional dependency - the default backend remains matplotlib. Install it with pip install pycba[plotly] (or pip install plotly).

Select the backend per call with the backend= argument on the plotting methods, or globally with set_backend():

import pycba as cba
cba.set_backend("plotly")          # all subsequent plots are interactive
beam_analysis.plot_results()       # -> a plotly Figure

The bending-moment panels keep PyCBA’s sagging-positive convention (the y-axis is reversed so sagging plots below the beam line), matching the matplotlib backend.

Functions

diagram_figure

Build an interactive single result diagram (bending moment, shear or deflection) from a pycba.MemberResults-like object.

envelope_figure

Build the interactive moment/shear envelope figure (two stacked panels) from a pycba.Envelopes object, with the max/min band shaded.

get_backend

Return the current default plotting backend.

resolve_backend

Resolve a per-call backend argument against the global default.

results_figure

Build the combined interactive bending-moment / shear / deflection figure (three stacked panels sharing the x-axis) from a member-results object.

set_backend

Set the default plotting backend used by the PyCBA result plots.