fdtdx.plot_material_from_side#
- fdtdx.plot_material_from_side(config, arrays, viewing_side, material_axis=0, filename=None, ax=None, plot_legend=True, position=0.0, type='permittivity')[source]#
Creates a visualization of material distribution from a single viewing side.
Generates a single subplot showing a 2D slice of the material distribution (permittivity or permeability) through the 3D simulation volume at a specified position.
- Parameters:
config (SimulationConfig) – Configuration object containing simulation parameters like resolution
arrays (ArrayContainer) – Container holding the material arrays (permittivity, permeability)
viewing_side (Literal['x', 'y', 'z']) – Which plane to view (‘x’ for YZ, ‘y’ for XZ, ‘z’ for XY)
material_axis (int) – Index into the leading component dimension of the material array (for anisotropic materials).
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 colorbar legend
position (float, optional) – Position of the slice in meters. Zero means at center, 1e-6 would mean center+1µm
type (MaterialType, optional) – Type of material to plot, either “permittivity” or “permeability”
- Returns:
The generated figure object
- Return type:
Figure
Note
The plots show material values in a 2D cross-section, with positions in micrometers.