# HG changeset patch # User luca_milaz # Date 1722789672 0 # Node ID d879c594013dd1ee58e589a81000ed4e156bbd7a # Parent 4617f8a3ab28e0bea9f566a6c3f72dc226e36ec4 Uploaded diff -r 4617f8a3ab28 -r d879c594013d marea_2/flux_to_map.py --- a/marea_2/flux_to_map.py Sun Aug 04 16:36:03 2024 +0000 +++ b/marea_2/flux_to_map.py Sun Aug 04 16:41:12 2024 +0000 @@ -820,9 +820,8 @@ def gray_to_red_cmap(value): """Map a normalized value to RGB color transitioning from gray to red.""" - # Ensure value is in the range [0, 1] value = abs(value) - r = value + 0.5 + r = 0.5 + 0.5 * value g = 0.5 - 0.5 * value b = 0.5 - 0.5 * value @@ -867,23 +866,23 @@ for rxn_id in ids: arrow = Arrow(width=5, col=colors_median[rxn_id]) - arrow.applyTo(arrow.getMapReactionId(rxn_id, mindReactionDir=False), metabMap_median, arrow.toStyleStr()) + arrow.applyTo(arrow.getMapReactionId(rxn_id, mindReactionDir=True), metabMap_median, arrow.toStyleStr()) # Now we style the arrow head(s): idOpt1, idOpt2 = getArrowHeadElementId(arrow.getMapReactionId(rxn_id, mindReactionDir=True)) arrow.applyTo(idOpt1, metabMap_median, arrow.toStyleStr(downSizedForTips = True)) if idOpt2: arrow.applyTo(idOpt2, metabMap_median, arrow.toStyleStr(downSizedForTips = True)) arrow = Arrow(width=5, col=colors_mean[rxn_id]) - arrow.applyTo(arrow.getMapReactionId(rxn_id, mindReactionDir=False), metabMap_mean, arrow.toStyleStr()) + arrow.applyTo(arrow.getMapReactionId(rxn_id, mindReactionDir=True), metabMap_mean, arrow.toStyleStr()) # Now we style the arrow head(s): idOpt1, idOpt2 = getArrowHeadElementId(arrow.getMapReactionId(rxn_id, mindReactionDir=True)) arrow.applyTo(idOpt1, metabMap_mean, arrow.toStyleStr(downSizedForTips = True)) if idOpt2: arrow.applyTo(idOpt2, metabMap_mean, arrow.toStyleStr(downSizedForTips = True)) - svgFilePath = utils.FilePath("SVG Map mean - class " + str(key), ext = utils.FileFormat.SVG, prefix="result") + svgFilePath = utils.FilePath("SVG Map mean - " + str(key), ext = utils.FileFormat.SVG, prefix="result") utils.writeSvg(svgFilePath, metabMap_mean) - svgFilePath = utils.FilePath("SVG Map median - class " + str(key), ext = utils.FileFormat.SVG, prefix="result") + svgFilePath = utils.FilePath("SVG Map median - " + str(key), ext = utils.FileFormat.SVG, prefix="result") utils.writeSvg(svgFilePath, metabMap_median)