Skip to content

Commit b80a50f

Browse files
tylerflexmomchil-flex
authored andcommitted
apply sim.plot and sim.plot_eps opacity kwargs to arrows
1 parent 247da50 commit b80a50f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

tidy3d/components/monitor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ def plot(
185185
# call the monitor.plot() function first
186186
ax = super().plot(x=x, y=y, z=z, ax=ax, **kwargs)
187187

188+
kwargs_alpha = kwargs.get("alpha")
189+
arrow_alpha = ARROW_ALPHA if kwargs_alpha is None else kwargs_alpha
190+
188191
# and then add an arrow using the direction comuputed from `_dir_arrow`.
189192
ax = self._plot_arrow(
190193
x=x,
@@ -193,7 +196,7 @@ def plot(
193196
ax=ax,
194197
direction=self._dir_arrow,
195198
color=ARROW_COLOR_MONITOR,
196-
alpha=ARROW_ALPHA,
199+
alpha=arrow_alpha,
197200
both_dirs=True,
198201
)
199202
return ax

tidy3d/components/source.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ def plot(
290290
# call the `Source.plot()` function first.
291291
ax = super().plot(x=x, y=y, z=z, ax=ax, **kwargs)
292292

293+
kwargs_alpha = kwargs.get("alpha")
294+
arrow_alpha = ARROW_ALPHA if kwargs_alpha is None else kwargs_alpha
295+
293296
# then add the arrow based on the propagation direction
294297
if self._dir_vector is not None:
295298

@@ -300,7 +303,7 @@ def plot(
300303
ax=ax,
301304
direction=self._dir_vector,
302305
color=ARROW_COLOR_SOURCE,
303-
alpha=ARROW_ALPHA,
306+
alpha=arrow_alpha,
304307
both_dirs=False,
305308
)
306309

@@ -313,7 +316,7 @@ def plot(
313316
ax=ax,
314317
direction=self._pol_vector,
315318
color=ARROW_COLOR_POLARIZATION,
316-
alpha=ARROW_ALPHA,
319+
alpha=arrow_alpha,
317320
both_dirs=False,
318321
)
319322

0 commit comments

Comments
 (0)