Loading DMT/core/mc_parameter.py +6 −2 Original line number Diff line number Diff line Loading @@ -510,13 +510,17 @@ class McParameter(object): # type check, either int or float is allowed if self.val_type == int: if int(value) != value: raise TypeError(f"The parameter {self:s} is of type Integer!") raise TypeError( f"The parameter {self:s} is of type Integer! Given was {value} of type {type(value)}." ) value = int(value) elif not isinstance( value, (int, float) ): # for floats also integer are allowed. This catches everything else like strings or lists etc. raise TypeError(f"The parameter {self:s} is of type Float!") raise TypeError( f"The parameter {self:s} is of type Float! Given was {value} of type {type(value)}." ) # range check value_too_large = False Loading DMT/core/plot.py +24 −45 Original line number Diff line number Diff line Loading @@ -141,10 +141,9 @@ PLOT_STYLES.append(XTRACTION_INTERPOLATED_COLOR) MIX = "mix" PLOT_STYLES.append(MIX) CYCLER_MARKERS = cycler(marker=[char for char in "x+v^*<>.so"]) CYCLER_LINESTYLES = cycler(linestyle=["-", "--", "-.", ":"]) CYCLER_COLORS = cycler( color=[ MARKERS = [char for char in "x+v^*<>.so"] LINESTYLES = ["-", "--", "-.", ":"] COLORS = [ "#006400", # darkgreen "#00008b", # darkblue "#b03060", # maroon3 Loading @@ -156,7 +155,10 @@ CYCLER_COLORS = cycler( "#ff00ff", # fuchsia "#6495ed", # cornflower ] ) CYCLER_MARKERS = cycler(marker=MARKERS) CYCLER_LINESTYLES = cycler(linestyle=LINESTYLES) CYCLER_COLORS = cycler(color=COLORS) ### Translation dictionaries from matplotlib to tikz Loading Loading @@ -191,7 +193,7 @@ _DICT_LINES_MPL_TO_PGF = { "--": "dashed, ", "-.": "dashdotted, ", "-": "solid, ", ".": "dotted, ", # ".": "dotted, ", # is used as a MARKER! ":": "dotted, ", # or densely dotted ?? } _DICT_COLORS_MPL = { Loading Loading @@ -457,32 +459,9 @@ class Plot(object): 'color', 'bw', 'markers_color', 'markers', 'markers_lines', 'xtraction', 'xtraction_color', 'xtraction_interpolated', 'xtraction_interpolated_color', """ markers = [char for char in "x+v^*<>.so"] linestyles = ["-", "--", "-.", ":"] # MM: replaced grey1 (#7f7f7f) with black(#) and grey2 with dark blue #1012d5. Does this cause problems? # MK: introduced completely new palette from https://mokole.com/palette.html (settings: 10 colors, 1% min, 80% max, 15000 loops, score 65.49) colors = [ # "#1f77b4", # "#ff7f0e", # "#2ca02c", # "#d62728", # "#9467bd", # "#e377c2", # "#8c564b", # "#0e1111", # "#1012d5", # "#17becf", "#006400", # darkgreen "#00008b", # darkblue "#b03060", # maroon3 "#ff0000", # red "#9467bd", # yellow -> replaced by violett/brown combo "#deb887", # curlywood "#00ff00", # lime "#00ffff", # aqua "#ff00ff", # fuchsia "#6495ed", # cornflower ] markers = MARKERS linestyles = LINESTYLES colors = COLORS if style == BLACK_WHITE: self._cycler = ( Loading Loading @@ -1538,7 +1517,7 @@ class Plot(object): + "]\n" + "\\pgfplotsset{every axis/.append style={" + line_width + "},compat=1.5},\n" + "},compat=1.18},\n" ) else: # if this figure is used in other tex documents, the axis are trimed so that figures with different y-labels and ticks get displayed nicely str_tikz_picture = ( Loading @@ -1547,7 +1526,7 @@ class Plot(object): + ", trim axis left, trim axis right, tight background]\n" + "\\pgfplotsset{every axis/.append style={" + line_width + "},compat=1.5}\n" + "},compat=1.18}\n" ) str_height = "" if height is None else "height=" + height + ",\n" if width is None: Loading Loading
DMT/core/mc_parameter.py +6 −2 Original line number Diff line number Diff line Loading @@ -510,13 +510,17 @@ class McParameter(object): # type check, either int or float is allowed if self.val_type == int: if int(value) != value: raise TypeError(f"The parameter {self:s} is of type Integer!") raise TypeError( f"The parameter {self:s} is of type Integer! Given was {value} of type {type(value)}." ) value = int(value) elif not isinstance( value, (int, float) ): # for floats also integer are allowed. This catches everything else like strings or lists etc. raise TypeError(f"The parameter {self:s} is of type Float!") raise TypeError( f"The parameter {self:s} is of type Float! Given was {value} of type {type(value)}." ) # range check value_too_large = False Loading
DMT/core/plot.py +24 −45 Original line number Diff line number Diff line Loading @@ -141,10 +141,9 @@ PLOT_STYLES.append(XTRACTION_INTERPOLATED_COLOR) MIX = "mix" PLOT_STYLES.append(MIX) CYCLER_MARKERS = cycler(marker=[char for char in "x+v^*<>.so"]) CYCLER_LINESTYLES = cycler(linestyle=["-", "--", "-.", ":"]) CYCLER_COLORS = cycler( color=[ MARKERS = [char for char in "x+v^*<>.so"] LINESTYLES = ["-", "--", "-.", ":"] COLORS = [ "#006400", # darkgreen "#00008b", # darkblue "#b03060", # maroon3 Loading @@ -156,7 +155,10 @@ CYCLER_COLORS = cycler( "#ff00ff", # fuchsia "#6495ed", # cornflower ] ) CYCLER_MARKERS = cycler(marker=MARKERS) CYCLER_LINESTYLES = cycler(linestyle=LINESTYLES) CYCLER_COLORS = cycler(color=COLORS) ### Translation dictionaries from matplotlib to tikz Loading Loading @@ -191,7 +193,7 @@ _DICT_LINES_MPL_TO_PGF = { "--": "dashed, ", "-.": "dashdotted, ", "-": "solid, ", ".": "dotted, ", # ".": "dotted, ", # is used as a MARKER! ":": "dotted, ", # or densely dotted ?? } _DICT_COLORS_MPL = { Loading Loading @@ -457,32 +459,9 @@ class Plot(object): 'color', 'bw', 'markers_color', 'markers', 'markers_lines', 'xtraction', 'xtraction_color', 'xtraction_interpolated', 'xtraction_interpolated_color', """ markers = [char for char in "x+v^*<>.so"] linestyles = ["-", "--", "-.", ":"] # MM: replaced grey1 (#7f7f7f) with black(#) and grey2 with dark blue #1012d5. Does this cause problems? # MK: introduced completely new palette from https://mokole.com/palette.html (settings: 10 colors, 1% min, 80% max, 15000 loops, score 65.49) colors = [ # "#1f77b4", # "#ff7f0e", # "#2ca02c", # "#d62728", # "#9467bd", # "#e377c2", # "#8c564b", # "#0e1111", # "#1012d5", # "#17becf", "#006400", # darkgreen "#00008b", # darkblue "#b03060", # maroon3 "#ff0000", # red "#9467bd", # yellow -> replaced by violett/brown combo "#deb887", # curlywood "#00ff00", # lime "#00ffff", # aqua "#ff00ff", # fuchsia "#6495ed", # cornflower ] markers = MARKERS linestyles = LINESTYLES colors = COLORS if style == BLACK_WHITE: self._cycler = ( Loading Loading @@ -1538,7 +1517,7 @@ class Plot(object): + "]\n" + "\\pgfplotsset{every axis/.append style={" + line_width + "},compat=1.5},\n" + "},compat=1.18},\n" ) else: # if this figure is used in other tex documents, the axis are trimed so that figures with different y-labels and ticks get displayed nicely str_tikz_picture = ( Loading @@ -1547,7 +1526,7 @@ class Plot(object): + ", trim axis left, trim axis right, tight background]\n" + "\\pgfplotsset{every axis/.append style={" + line_width + "},compat=1.5}\n" + "},compat=1.18}\n" ) str_height = "" if height is None else "height=" + height + ",\n" if width is None: Loading