fdtdx.plot_setup_from_side#
- fdtdx.plot_setup_from_side(config, objects, viewing_side, exclude_object_list=None, filename=None, ax=None, plot_legend=True, exclude_xy_plane_object_list=None, exclude_yz_plane_object_list=None, exclude_xz_plane_object_list=None, exclude_large_object_ratio=None, auto_exclude_full_coverage=True)[source]#
Creates a visualization of the simulation setup from a single viewing side.
Generates a single subplot showing a cross-section of the simulation volume and the objects within it from the specified viewing side. Objects are drawn as colored rectangles with optional legends.
- Parameters:
config (SimulationConfig) – Configuration object containing simulation parameters like resolution
objects (ObjectContainer) – Container holding all simulation objects to be plotted
viewing_side (Literal['x', 'y', 'z']) – Which plane to view (‘x’ for YZ, ‘y’ for XZ, ‘z’ for XY)
exclude_object_list (list[SimulationObject] | None, optional) – List of objects to exclude from all plots
filename (str | Path | None, optional) – If provided, saves the plot to this file instead of displaying
ax (Any | None, optional) – Optional matplotlib axis to plot on. If None, creates new figure
plot_legend (bool, optional) – Whether to add a legend showing object names/types
exclude_xy_plane_object_list (list[SimulationObject] | None, optional) – Objects to exclude from XY plane plot
exclude_yz_plane_object_list (list[SimulationObject] | None, optional) – Objects to exclude from YZ plane plot
exclude_xz_plane_object_list (list[SimulationObject] | None, optional) – Objects to exclude from XZ plane plot
exclude_large_object_ratio (float | None, optional) – If provided, excludes objects that cover more than this ratio of the image (e.g., 1.0 excludes objects covering 100% of the image)
auto_exclude_full_coverage (bool, optional) – Automatically exclude objects that cover 100% of the viewing plane
- Returns:
The generated figure object
- Return type:
Figure
Note
The plots show object positions in micrometers, converting from simulation units. PML objects are automatically excluded from their respective boundary planes.