Skip to content

tidy3d_plot

tidy3d_plot(
obj: photonforge.Component
| photonforge.Port
| photonforge.FiberPort
| photonforge.PortSpec,
frequency: float | None = None,
technology: photonforge.Technology | None = None,
plot_type: Literal['3d', 'eps', 'structures'] | None = None,
plot_grid: bool = False,
**kwargs: object,
) -> object

Helper function to plot a component through Tidy3D.

Args

  • obj: Object to be plotted (Component, Port, FiberPort, or PortSpec).
  • frequency: Frequency to use when creating the simulation object and ploting media. If not set, it will be automatically selected from the technology media.
  • technology: Technology to use. If not set, use the component’s or the default technology.
  • plot_type: Type of plot to use. Use default plot when not set.
  • plot_grid: Flag to enable plotting the simulation grid.
  • kwargs: Keyword arguments passed to the plot function.

Returns

Matplotlib axis used for ploting.

Example

>>> technology = pf.basic_technology()
>>> component = pf.parametric.bend(
... port_spec="Strip", radius=10, technology=technology
... )
>>> pf.tidy3d_plot(component, z=0.1)
<Axes: ...>

Note

Instances of Port and PortSpec can only be plotted with Tidy3D versions 2.7.1 and above.