fdtdx.plot_field_slice_component#
- fdtdx.plot_field_slice_component(field, component_name, ax, plot_legend=True)[source]#
Plots a single component of the electromagnetic field.
- Parameters:
field (jnp.ndarray) – 2D array of shape (w, h) containing field values
component_name (str) – Name of the component (e.g., ‘Ex’, ‘Hy’)
ax (Any) – Matplotlib axis to plot on
plot_legend (bool, optional) – Whether to add a colorbar legend
- Raises:
ValueError – If field is not 2D or contains invalid values
- Return type:
None