From a68e2c94468c4320ea67ad3fbcceab796847b916 Mon Sep 17 00:00:00 2001 From: Will Robertson Date: Tue, 9 Apr 2024 11:25:40 +0930 Subject: [PATCH] factor out another One ugly line left over but deal with it later --- ausankey/ausankey.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ausankey/ausankey.py b/ausankey/ausankey.py index adec1e5..6309acf 100644 --- a/ausankey/ausankey.py +++ b/ausankey/ausankey.py @@ -486,10 +486,6 @@ def subplot(self, ii): self.data[2 * ii + 2], self.data[2 * ii + lastind], ] - weights_lr = [ - self.data[2 * ii + 1], - self.data[2 * ii + 1 + 2], - ] # vertical positions y_node_gap = self.node_gap * self.plot_height_nom @@ -522,7 +518,7 @@ def subplot(self, ii): for lr in [0, 1]: for i, label in enumerate(self.node_list[ii + lr]): node_height = self.node_sizes[ii + lr][label] - this_side_height = weights_lr[lr][labels_lr[lr] == label].sum() + this_side_height = self.data[2 * (ii + lr) + 1][labels_lr[lr] == label].sum() node_voffset[lr][label] = self.vscale * (node_height - this_side_height) next_bot = node_pos_top[lr][self.node_list[ii + lr][i - 1]] + y_node_gap if i > 0 else 0 node_pos_bot[lr][label] = self.voffset[ii + lr] if i == 0 else next_bot