From 05607741b0ddfb5963a3e6b18bba34bd6f4a57d2 Mon Sep 17 00:00:00 2001 From: Klaus Weinbauer Date: Thu, 9 Jun 2022 19:24:34 +0200 Subject: [PATCH] Fix issue in plot functions Correct type conversion and column calculation for subplot matrix. --- ace/ace.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ace/ace.py b/ace/ace.py index 378635b..ad4d8b0 100644 --- a/ace/ace.py +++ b/ace/ace.py @@ -222,7 +222,7 @@ def plot_transforms(ace_model, fname='ace_transforms.png'): raise ImportError('Cannot plot without the matplotlib package') plt.rcParams.update({'font.size': 8}) plt.figure() - num_cols = len(ace_model.x) / 2 + 1 + num_cols = int(len(ace_model.x) / 2) + 1 for i in range(len(ace_model.x)): plt.subplot(num_cols, 2, i + 1) plt.plot(ace_model.x[i], ace_model.x_transforms[i], '.', label='Phi {0}'.format(i)) @@ -245,7 +245,7 @@ def plot_input(ace_model, fname='ace_input.png'): raise ImportError('Cannot plot without the matplotlib package') plt.rcParams.update({'font.size': 8}) plt.figure() - num_cols = len(ace_model.x) / 2 + 1 + num_cols = int(len(ace_model.x) / 2) + 1 for i in range(len(ace_model.x)): plt.subplot(num_cols, 2, i + 1) plt.plot(ace_model.x[i], ace_model.y, '.')