Visualization Overview
Tools for rendering trajectories, basins, and analytical charts.
The hidden-attractors-fo library provides a dedicated plotting module that wraps Matplotlib to generate consistent, publication-ready figures.
Rather than writing custom boilerplate for every script, these functions handle the tedious work of 3D projection, axis labeling, color cycling, and legend generation.
Available Plotting Tools
- Trajectory Plots: Renders one or more time-series trajectories in 2D or 3D space, optionally overlaying the system’s equilibria as markers.
- Basin Grids: Visualizes a 2D slice of the phase space, coloring each initial condition according to its classified
BasinLabel. - Bifurcation Diagrams: Plots the local maxima of a state variable against a sweeping parameter.
- Poincaré Maps: Scatters the discrete intersections of a trajectory with a Poincaré plane.
Styling
All plotting functions accept standard Matplotlib **kwargs. For example, you can pass figsize, dpi, alpha, or cmap to customize the output.
If you prefer to integrate the plots into an existing Matplotlib figure (for example, to create a multi-panel subplot layout), most functions accept an optional ax parameter.
import matplotlib.pyplot as plt
from hidden_attractors.plotting import plot_overlay_trajectories
fig = plt.figure(figsize=(12, 6))
# Left panel: 3D view
ax1 = fig.add_subplot(121, projection='3d')
plot_overlay_trajectories(solutions, ax=ax1, view_3d=True)
# Right panel: 2D projection
ax2 = fig.add_subplot(122)
plot_overlay_trajectories(solutions, ax=ax2, view_3d=False)
plt.show()