@@ -165,7 +165,7 @@ def simulation_geometry(self) -> Box:
165165 @cached_property
166166 def simulation_structure (self ) -> Structure :
167167 """Returns structure representing the domain of the simulation. This differs from
168- ``Simulation.background_structure`` in that it has finite extent."""
168+ ``Simulation.scene. background_structure`` in that it has finite extent."""
169169 return Structure (geometry = self .simulation_geometry , medium = self .medium )
170170
171171 @equal_aspect
@@ -416,6 +416,178 @@ def plot_boundaries(
416416 The supplied or created matplotlib axes.
417417 """
418418
419+ @equal_aspect
420+ @add_ax_if_none
421+ def plot_structures (
422+ self ,
423+ x : float = None ,
424+ y : float = None ,
425+ z : float = None ,
426+ ax : Ax = None ,
427+ hlim : Tuple [float , float ] = None ,
428+ vlim : Tuple [float , float ] = None ,
429+ ) -> Ax :
430+ """Plot each of simulation's structures on a plane defined by one nonzero x,y,z coordinate.
431+
432+ Parameters
433+ ----------
434+ x : float = None
435+ position of plane in x direction, only one of x, y, z must be specified to define plane.
436+ y : float = None
437+ position of plane in y direction, only one of x, y, z must be specified to define plane.
438+ z : float = None
439+ position of plane in z direction, only one of x, y, z must be specified to define plane.
440+ ax : matplotlib.axes._subplots.Axes = None
441+ Matplotlib axes to plot on, if not specified, one is created.
442+ hlim : Tuple[float, float] = None
443+ The x range if plotting on xy or xz planes, y range if plotting on yz plane.
444+ vlim : Tuple[float, float] = None
445+ The z range if plotting on xz or yz planes, y plane if plotting on xy plane.
446+
447+ Returns
448+ -------
449+ matplotlib.axes._subplots.Axes
450+ The supplied or created matplotlib axes.
451+ """
452+
453+ hlim_new , vlim_new = Scene ._get_plot_lims (
454+ bounds = self .simulation_bounds , x = x , y = y , z = z , hlim = hlim , vlim = vlim
455+ )
456+
457+ return self .scene .plot_structures (x = x , y = y , z = z , ax = ax , hlim = hlim_new , vlim = vlim_new )
458+
459+ @equal_aspect
460+ @add_ax_if_none
461+ def plot_structures_eps (
462+ self ,
463+ x : float = None ,
464+ y : float = None ,
465+ z : float = None ,
466+ freq : float = None ,
467+ alpha : float = None ,
468+ cbar : bool = True ,
469+ reverse : bool = False ,
470+ ax : Ax = None ,
471+ hlim : Tuple [float , float ] = None ,
472+ vlim : Tuple [float , float ] = None ,
473+ ) -> Ax :
474+ """Plot each of simulation's structures on a plane defined by one nonzero x,y,z coordinate.
475+ The permittivity is plotted in grayscale based on its value at the specified frequency.
476+
477+ Parameters
478+ ----------
479+ x : float = None
480+ position of plane in x direction, only one of x, y, z must be specified to define plane.
481+ y : float = None
482+ position of plane in y direction, only one of x, y, z must be specified to define plane.
483+ z : float = None
484+ position of plane in z direction, only one of x, y, z must be specified to define plane.
485+ freq : float = None
486+ Frequency to evaluate the relative permittivity of all mediums.
487+ If not specified, evaluates at infinite frequency.
488+ reverse : bool = False
489+ If ``False``, the highest permittivity is plotted in black.
490+ If ``True``, it is plotteed in white (suitable for black backgrounds).
491+ cbar : bool = True
492+ Whether to plot a colorbar for the relative permittivity.
493+ alpha : float = None
494+ Opacity of the structures being plotted.
495+ Defaults to the structure default alpha.
496+ ax : matplotlib.axes._subplots.Axes = None
497+ Matplotlib axes to plot on, if not specified, one is created.
498+ hlim : Tuple[float, float] = None
499+ The x range if plotting on xy or xz planes, y range if plotting on yz plane.
500+ vlim : Tuple[float, float] = None
501+ The z range if plotting on xz or yz planes, y plane if plotting on xy plane.
502+
503+ Returns
504+ -------
505+ matplotlib.axes._subplots.Axes
506+ The supplied or created matplotlib axes.
507+ """
508+
509+ hlim , vlim = Scene ._get_plot_lims (
510+ bounds = self .simulation_bounds , x = x , y = y , z = z , hlim = hlim , vlim = vlim
511+ )
512+
513+ return self .scene .plot_structures_eps (
514+ freq = freq ,
515+ cbar = cbar ,
516+ alpha = alpha ,
517+ ax = ax ,
518+ x = x ,
519+ y = y ,
520+ z = z ,
521+ hlim = hlim ,
522+ vlim = vlim ,
523+ reverse = reverse ,
524+ )
525+
526+ @equal_aspect
527+ @add_ax_if_none
528+ def plot_structures_heat_conductivity (
529+ self ,
530+ x : float = None ,
531+ y : float = None ,
532+ z : float = None ,
533+ alpha : float = None ,
534+ cbar : bool = True ,
535+ reverse : bool = False ,
536+ ax : Ax = None ,
537+ hlim : Tuple [float , float ] = None ,
538+ vlim : Tuple [float , float ] = None ,
539+ ) -> Ax :
540+ """Plot each of simulation's structures on a plane defined by one nonzero x,y,z coordinate.
541+ The permittivity is plotted in grayscale based on its value at the specified frequency.
542+
543+ Parameters
544+ ----------
545+ x : float = None
546+ position of plane in x direction, only one of x, y, z must be specified to define plane.
547+ y : float = None
548+ position of plane in y direction, only one of x, y, z must be specified to define plane.
549+ z : float = None
550+ position of plane in z direction, only one of x, y, z must be specified to define plane.
551+ freq : float = None
552+ Frequency to evaluate the relative permittivity of all mediums.
553+ If not specified, evaluates at infinite frequency.
554+ reverse : bool = False
555+ If ``False``, the highest permittivity is plotted in black.
556+ If ``True``, it is plotteed in white (suitable for black backgrounds).
557+ cbar : bool = True
558+ Whether to plot a colorbar for the relative permittivity.
559+ alpha : float = None
560+ Opacity of the structures being plotted.
561+ Defaults to the structure default alpha.
562+ ax : matplotlib.axes._subplots.Axes = None
563+ Matplotlib axes to plot on, if not specified, one is created.
564+ hlim : Tuple[float, float] = None
565+ The x range if plotting on xy or xz planes, y range if plotting on yz plane.
566+ vlim : Tuple[float, float] = None
567+ The z range if plotting on xz or yz planes, y plane if plotting on xy plane.
568+
569+ Returns
570+ -------
571+ matplotlib.axes._subplots.Axes
572+ The supplied or created matplotlib axes.
573+ """
574+
575+ hlim , vlim = Scene ._get_plot_lims (
576+ bounds = self .simulation_bounds , x = x , y = y , z = z , hlim = hlim , vlim = vlim
577+ )
578+
579+ return self .scene .plot_structures_heat_conductivity (
580+ cbar = cbar ,
581+ alpha = alpha ,
582+ ax = ax ,
583+ x = x ,
584+ y = y ,
585+ z = z ,
586+ hlim = hlim ,
587+ vlim = vlim ,
588+ reverse = reverse ,
589+ )
590+
419591 @classmethod
420592 def from_scene (cls , scene : Scene , ** kwargs ) -> AbstractSimulation :
421593 """Create a simulation from a :class:.`Scene` instance. Must provide additional parameters
0 commit comments