Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion tidy3d/components/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ def plot(
# call the monitor.plot() function first
ax = super().plot(x=x, y=y, z=z, ax=ax, **kwargs)

kwargs_alpha = kwargs.get("alpha")
arrow_alpha = ARROW_ALPHA if kwargs_alpha is None else kwargs_alpha

# and then add an arrow using the direction comuputed from `_dir_arrow`.
ax = self._plot_arrow(
x=x,
Expand All @@ -193,7 +196,7 @@ def plot(
ax=ax,
direction=self._dir_arrow,
color=ARROW_COLOR_MONITOR,
alpha=ARROW_ALPHA,
alpha=arrow_alpha,
both_dirs=True,
)
return ax
Expand Down
7 changes: 5 additions & 2 deletions tidy3d/components/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ def plot(
# call the `Source.plot()` function first.
ax = super().plot(x=x, y=y, z=z, ax=ax, **kwargs)

kwargs_alpha = kwargs.get("alpha")
arrow_alpha = ARROW_ALPHA if kwargs_alpha is None else kwargs_alpha

# then add the arrow based on the propagation direction
if self._dir_vector is not None:

Expand All @@ -300,7 +303,7 @@ def plot(
ax=ax,
direction=self._dir_vector,
color=ARROW_COLOR_SOURCE,
alpha=ARROW_ALPHA,
alpha=arrow_alpha,
both_dirs=False,
)

Expand All @@ -313,7 +316,7 @@ def plot(
ax=ax,
direction=self._pol_vector,
color=ARROW_COLOR_POLARIZATION,
alpha=ARROW_ALPHA,
alpha=arrow_alpha,
both_dirs=False,
)

Expand Down