plot_s_matrix

photonforge.plot_s_matrix(s_matrix, input_ports=(), output_ports=(), x='wavelength', y='magnitude', threshold=0.1, show_progress=True, model_kwargs={})

Helper function to plot a component S matrix.

Parameters:
  • s_matrix (SMatrix) – S parameters t be plotted.

  • input_ports (Sequence[str]) – Sequence of port names that will be used as input for plotting. If empty, all available ports are used.

  • output_ports (Sequence[str]) – Sequence of port names that will be used as output for plotting. If empty, all available ports are used.

  • x (Literal['wavelength', 'frequency']) – Value used for the x axis. One of “wavelength” or “frequency”.

  • y (Literal['magnitude', 'phase', 'real', 'imag', 'dB']) – Value to be plotted in the y axis. One of “magnitude”, “phase”, “real”, “imag”, or “dB”.

  • threshold (float) – Threshold value for the squared magnitude of the S parameter. Curves below this threshold are plotted separately or ignored (for phase plots).

  • show_progress (bool) – If True, show S matrix computation progress.

  • model_kwargs (dict[str, Any]) – Keyword arguments passed to the model for S matrix computation. Each model type can accept a different set of arguments. Check the documentation for the specific model for more information.

Returns:

Created matplotlib figure and axes.

Return type:

fig, ax

Note

This function requires the module matplotlib.pyplot.