From d10a03287969cb3b235af5c3fead0faa907e7f1e Mon Sep 17 00:00:00 2001 From: tylerflex Date: Fri, 29 Apr 2022 10:09:51 -0700 Subject: [PATCH] apply sim.plot and sim.plot_eps opacity kwargs to arrows --- tidy3d/components/monitor.py | 5 ++++- tidy3d/components/source.py | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tidy3d/components/monitor.py b/tidy3d/components/monitor.py index 2356f8f03a..da4584be37 100644 --- a/tidy3d/components/monitor.py +++ b/tidy3d/components/monitor.py @@ -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, @@ -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 diff --git a/tidy3d/components/source.py b/tidy3d/components/source.py index 853971af0e..bd6c86edd1 100644 --- a/tidy3d/components/source.py +++ b/tidy3d/components/source.py @@ -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: @@ -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, ) @@ -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, )