fdtdx.plot_setup

Contents

fdtdx.plot_setup#

fdtdx.plot_setup(config, objects, exclude_object_list=None, filename=None, axs=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 showing objects in XY, XZ and YZ planes.

Generates three subplots showing cross-sections of the simulation volume and the objects within it. Objects are drawn as colored rectangles with optional legends. The visualization helps verify the correct positioning and sizing of objects in the simulation setup.

Parameters:
  • config (SimulationConfig) – Configuration object containing simulation parameters like resolution

  • objects (ObjectContainer) – Container holding all simulation objects to be plotted

  • 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

  • axs (Any | None, optional) – Optional matplotlib axes 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. Objects covering 100% of a viewing plane are automatically excluded by default.