tidy3d.Simulation.viz_modes

Simulation.viz_modes(mode_obj, freq_ind=0, mode_inds=None, fig_width=8.0, val='abs', cbar=False, clim=None, eps_alpha=0.3)

Plot the field distribution of the 2D eigenmodes of a ModeSource or a ModeMonitor object. Mode data already stored in the object may be used.

Parameters
  • mode_obj (ModeSource or ModeMonitor) – An object on which Simulation.compute_modes() can be used.

  • freq_ind (int, optional) – Frequency index of the stored modes to be plotted.

  • mode_inds (array_like or None, optional) – If provided, only visualize the modes with specified indexes.

  • fig_width (float) – Width in inches of figure. The height depends on the number of plotted modes and the aspect ratio.

  • val ({'re', 'im', 'abs'}, optional) – Plot the real part (default), or the imaginary or absolute value of the field components.

  • cbar (bool, optional) – Add a colorbar to the plot.

  • clim (List[float], optional) – Matplotlib color limit to use for plot.

  • eps_alpha (float, optional) – If larger than zero, overlay the underlying permittivity distribution, with opacity defined by eps_alpha.

Returns

Return type

Matplotlib figure object

Note

The modes of the mode_object must have been previously computed with compute_modes().