From 5cf04d3a9bc477de8143570f9fadbbc99fd14a75 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 18 Jun 2025 11:39:49 -0500 Subject: [PATCH] Fix NegLog10 Scaling Issue where scale only applied on new entry to negLog10 mode --- +nla/+gfx/+plots/MatrixPlot.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/+nla/+gfx/+plots/MatrixPlot.m b/+nla/+gfx/+plots/MatrixPlot.m index 27e039f3..8c11af34 100644 --- a/+nla/+gfx/+plots/MatrixPlot.m +++ b/+nla/+gfx/+plots/MatrixPlot.m @@ -221,11 +221,14 @@ function applyScale(obj, ~, ~, upper_limit_box, lower_limit_box, old_scale, new_ obj.lower_limit = 0; obj.upper_limit = obj.p_value_max; elseif ~ismember(old_scale, ["nla.gfx.ProbPlotMethod.NEGATIVE_LOG_10", "nla.gfx.ProbPlotMethod.NEGATIVE_LOG_STATISTIC"]) &&... - ~ismember(new_scale, ["nla.gfx.ProbPlotMethod.DEFAULT", "nla.gfx.ProbPlotMethod.LOG"]) - obj.matrix.v = -log10(obj.matrix.v); + ~ismember(new_scale, ["nla.gfx.ProbPlotMethod.DEFAULT", "nla.gfx.ProbPlotMethod.LOG"]) obj.lower_limit = 0; obj.upper_limit = 2; end + + if ismember(new_scale, ["nla.gfx.ProbPlotMethod.NEGATIVE_LOG_10", "nla.gfx.ProbPlotMethod.NEGATIVE_LOG_STATISTIC"]) + obj.matrix.v = -log10(obj.matrix.v); + end discrete_colors = NetworkResultPlotParameter().default_discrete_colors;