Skip to content

Commit

Permalink
Improve logic for loop
Browse files Browse the repository at this point in the history
Co-authored-by: Kyle Conroy <kyleconroy@gmail.com>
  • Loading branch information
rosteen and kecnry committed Nov 13, 2023
1 parent 786ce7a commit b47d9bf
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions jdaviz/configs/default/plugins/plot_options/plot_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,15 +641,12 @@ def apply_RGB_presets(self):
# Sample along a colormap if we have too many layers
if n_visible > len(preset_colors):
cmap = matplotlib.colormaps['gist_rainbow'].resampled(n_visible)
preset_colors = [matplotlib.colors.to_hex(cmap(i), keep_alpha=True) for i in range(n_visible)]

for i in range(n_visible):
self.layer_selected = visible_layers[i]
self.image_opacity_value = default_opacity
if n_visible <= len(preset_colors):
self.image_color_value = preset_colors[i]
else:
self.image_color_value = matplotlib.colors.to_hex(cmap(i), keep_alpha=True)

self.image_color_value = preset_colors[i]
self.stretch_function_value = "arcsinh"
self.stretch_preset_value = 99

Expand Down

0 comments on commit b47d9bf

Please sign in to comment.