Skip to content

Commit 2f3646a

Browse files
committed
fix: correct reversed color mapping for colorbar
1 parent 2077675 commit 2f3646a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tidy3d/components/scene.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1450,7 +1450,10 @@ def _get_structure_eps_plot_params(
14501450
if norm is not None:
14511451
# Use the same normalization as the colorbar for consistency
14521452
color = norm(eps_medium)
1453-
if reverse:
1453+
# TODO: This is a hack to ensure color consistency with the colorbar.
1454+
# It should be removed once we establish a proper color mapping where
1455+
# eps_min maps to 0 and eps_max maps to 1 for 'reverse=False'.
1456+
if not reverse:
14541457
color = 1 - color
14551458
color = min(1, max(color, 0)) # clip in case of custom eps limits
14561459
else:

0 commit comments

Comments
 (0)