Skip to content
Snippets Groups Projects
Commit a76a8e2e authored by Eva Schiffer's avatar Eva Schiffer
Browse files

less eye searing colormaps for the gui

parent cb94bb06
No related branches found
No related tags found
No related merge requests found
...@@ -81,16 +81,6 @@ GREEN_VAR_NAME = "green" ...@@ -81,16 +81,6 @@ GREEN_VAR_NAME = "green"
BLUE_VAR_NAME = "blue" BLUE_VAR_NAME = "blue"
ALPHA_VAR_NAME = "alpha" ALPHA_VAR_NAME = "alpha"
# colormaps that are available in the GUI
# TODO, this needs to be upkept when the list of colormaps in the figure manager changes
CM_RAINBOW = "Rainbow"
CM_RAINBOW_REV = "Rainbow, Reverse"
CM_RAINBOW_DESAT = "Rainbow, Desaturated"
CM_GRAY = "Grayscale"
CM_GRAY_REV = "Grayscale, Reverse"
CM_SPECTRAL = "Rainbow2"
COLORMAP_NAMES = [CM_RAINBOW, CM_RAINBOW_REV, CM_RAINBOW_DESAT, CM_GRAY, CM_GRAY_REV, CM_SPECTRAL]
NO_DATA_MESSAGE = "Requested data was not available or did not exist." NO_DATA_MESSAGE = "Requested data was not available or did not exist."
UNKNOWN_DATA_FORM = "An ununsupported plot format was requested. Aborting attempt to plot data." UNKNOWN_DATA_FORM = "An ununsupported plot format was requested. Aborting attempt to plot data."
......
...@@ -33,16 +33,21 @@ temp_dict = {'blue': [(0.0, 0.58333333333333326, 0.58333333333333326), (0.11, 0. ...@@ -33,16 +33,21 @@ temp_dict = {'blue': [(0.0, 0.58333333333333326, 0.58333333333333326), (0.11, 0.
DESAT_MAP = matplotlib.colors.LinearSegmentedColormap('colormap', temp_dict, 1024) DESAT_MAP = matplotlib.colors.LinearSegmentedColormap('colormap', temp_dict, 1024)
# colormaps that are available in the GUI # colormaps that are available in the GUI
# if this changes the list of colormap names in the constants module needs to be kept up temp_spectral = cm.spectral if hasattr(cm, 'spectral') else cm.Spectral # newer matplotlib changed the name of this color map
temp_spectral = cm.spectral if hasattr(cm, 'spectral') else cm.Spectral # newer matplotlib changed the name of this color map temp_rspectral = cm.spectral_r if hasattr(cm, 'spectral_r') else cm.Spectral_r
AVAILABLE_COLORMAPS = { AVAILABLE_COLORMAPS = {
CM_RAINBOW: cm.jet, "Viridis": cm.viridis,
CM_RAINBOW_REV: cm.jet_r, "Cividis": cm.cividis,
CM_RAINBOW_DESAT: DESAT_MAP, "Plasma": cm.plasma,
CM_GRAY: cm.bone, "Ocean": cm.ocean,
CM_GRAY_REV: cm.bone_r, "Spectral Rainbow": temp_spectral,
CM_SPECTRAL: temp_spectral, "Spectral Rainbow, Reverse": temp_rspectral,
"Grayscale": cm.bone,
"Grayscale, Reverse": cm.bone_r,
} }
# note: we expect other modules to reference the COLORMAP_NAMES
COLORMAP_NAMES = list(AVAILABLE_COLORMAPS.keys())
# whether or not the plot can be drawn on a map # whether or not the plot can be drawn on a map
CAN_BE_MAPPED = { CAN_BE_MAPPED = {
......
...@@ -13,7 +13,8 @@ from os import path ...@@ -13,7 +13,8 @@ from os import path
import glance.data as dataobjects import glance.data as dataobjects
import glance.io as io import glance.io as io
from glance.gui_constants import * from glance.gui_constants import *
from glance.gui_figuremanager import COLORMAP_NAMES
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment