From 312ff6a1d220044ab55e8926b472f76e1795c201 Mon Sep 17 00:00:00 2001 From: Arunima Chaudhuri Date: Thu, 7 Mar 2024 18:25:36 +0530 Subject: [PATCH] fix warnings on ecdfRestore row col Count Signed-off-by: Arunima Chaudhuri --- DAS/visualizor.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/DAS/visualizor.py b/DAS/visualizor.py index a10143b..5c48eaa 100644 --- a/DAS/visualizor.py +++ b/DAS/visualizor.py @@ -278,7 +278,8 @@ class Visualizor: plt.xlabel(conf["xlabel"]) plt.ylabel(conf["ylabel"]) plt.title(conf["title"]) - plt.xlim(left=0, right=max(result.restoreRowCount) * 1.1) + max_val = max(result.restoreRowCount) * 1.1 + plt.xlim(left=0, right=max_val if max_val > 0 else 1) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.legend(title='Node Class', labels=['Class 1 Nodes', 'Class 2 Nodes'], loc=1) @@ -304,7 +305,8 @@ class Visualizor: plt.xlabel(conf["xlabel"]) plt.ylabel(conf["ylabel"]) plt.title(conf["title"]) - plt.xlim(left=0, right=max(result.restoreColumnCount) * 1.1) + max_val = max(result.restoreColumnCount) * 1.1 + plt.xlim(left=0, right=max_val if max_val > 0 else 1) props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) plt.text(1.05, 0.05, conf["textBox"], fontsize=10, verticalalignment='bottom', transform=plt.gca().transAxes, bbox=props) plt.legend(title='Node Class', labels=['Class 1 Nodes', 'Class 2 Nodes'], loc=1)