Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 63 additions & 12 deletions gplugins/modes/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,15 @@ def plot_eps(
self,
cmap: str = "binary",
origin="lower",
logscale: bool = False,
show: bool = True,
) -> None:
"""Plot index profile."""
"""Plot index profile.

Args:
cmap: colormap.
origin: origin of the plot.
show: show the plot.
"""
plt.imshow(
self.eps**0.5,
cmap=cmap,
Expand Down Expand Up @@ -277,22 +282,46 @@ def plot_e_all(
plt.figure(figsize=(16, 10), dpi=100)

plt.subplot(2, 3, 1)
self.plot_ex(show=False, scale=scale, cmap=cmap, operation=operation)
self.plot_ex(
show=False,
scale=scale,
cmap=cmap,
operation=operation,
origin=origin,
logscale=logscale,
)

plt.subplot(2, 3, 2)
self.plot_ey(show=False, scale=scale, cmap=cmap, operation=operation)
self.plot_ey(
show=False,
scale=scale,
cmap=cmap,
operation=operation,
origin=origin,
logscale=logscale,
)

plt.subplot(2, 3, 3)
self.plot_ez(show=False, scale=scale, cmap=cmap, operation=operation)
self.plot_ez(
show=False,
scale=scale,
cmap=cmap,
operation=operation,
origin=origin,
logscale=logscale,
)

plt.subplot(2, 3, 4)
self.plot_e(show=False, scale=scale)
self.plot_e(
show=False, scale=scale, cmap=cmap, origin=origin, logscale=logscale
)

plt.subplot(2, 3, 5)
self.plot_eps(show=False)

plt.tight_layout()
plt.show()
if show:
plt.show()

def plot_h(
self,
Expand Down Expand Up @@ -422,22 +451,44 @@ def plot_h_all(
plt.figure(figsize=(16, 10), dpi=100)

plt.subplot(2, 3, 1)
self.plot_hx(show=False, scale=scale, cmap=cmap, operation=operation)
self.plot_hx(
show=False,
scale=scale,
cmap=cmap,
operation=operation,
origin=origin,
logscale=logscale,
)

plt.subplot(2, 3, 2)
self.plot_hy(show=False, scale=scale, cmap=cmap, operation=operation)
self.plot_hy(
show=False,
scale=scale,
cmap=cmap,
operation=operation,
origin=origin,
logscale=logscale,
)

plt.subplot(2, 3, 3)
self.plot_hz(show=False, scale=scale, cmap=cmap, operation=operation)
self.plot_hz(
show=False,
scale=scale,
cmap=cmap,
operation=operation,
origin=origin,
logscale=logscale,
)

plt.subplot(2, 3, 4)
self.plot_h(show=False, scale=scale)
self.plot_h(show=False, scale=scale, origin=origin, logscale=logscale)

plt.subplot(2, 3, 5)
self.plot_eps(show=False)

plt.tight_layout()
plt.show()
if show:
plt.show()


class Waveguide(BaseModel):
Expand Down