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
22 changes: 10 additions & 12 deletions tidy3d/components/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from functools import wraps

import matplotlib.pylab as plt
from matplotlib import colors
from pydantic import BaseModel

from .types import Ax
Expand Down Expand Up @@ -118,22 +117,21 @@ class StructMediumParams(PatchParamSwitcher):
def get_plot_params(self) -> PatchParams:
"""Returns :class:`PatchParams` based on user-supplied args."""
mat_index = self.medium_map[self.medium]
pick_c = [
"midnightblue",
"maroon",
"darkmagenta",
"dodgerblue",
"steelblue",
"indigo",
"firebrick",
"skyblue",
mat_cmap = [
"#689DBC",
"#D0698E",
"#5E6EAD",
"#C6224E",
"#BDB3E2",
"#9EC3E0",
"#616161",
"#877EBC",
]
mat_cmap = [colors.CSS4_COLORS[c] for c in pick_c]

if mat_index == 0:
facecolor = "white"
else:
facecolor = mat_cmap[(mat_index - 1) % len(pick_c)]
facecolor = mat_cmap[(mat_index - 1) % len(mat_cmap)]
if self.medium.name == "PEC":
return PatchParams(facecolor="gold", edgecolor="k", lw=1)
return PatchParams(facecolor=facecolor, edgecolor=facecolor, lw=0)
Expand Down