From 686b7ecc6891babc5590602b5ba569fe3732f486 Mon Sep 17 00:00:00 2001 From: Attila Gabor Date: Fri, 21 Jun 2024 09:48:32 +0200 Subject: [PATCH] fix perturbation plots --- corneto/methods/signal/cellnopt_ilp.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/corneto/methods/signal/cellnopt_ilp.py b/corneto/methods/signal/cellnopt_ilp.py index b1f7d922..0a6b1e2c 100644 --- a/corneto/methods/signal/cellnopt_ilp.py +++ b/corneto/methods/signal/cellnopt_ilp.py @@ -404,9 +404,11 @@ def plot_fitness(G, exp_list, P, measured_only=False, **kwargs): # depending on the flag measured_only, we can plot only the measured nodes or all nodes if measured_only: - fig, axs = plt.subplots(N_exps - 1, len(output_names)+1, squeeze=False, **kwargs) + fig, axs = plt.subplots( + N_exps - 1, len(output_names) + 1, squeeze=False, **kwargs + ) else: - fig, axs = plt.subplots(N_exps - 1, N_nodes+1, squeeze=False, **kwargs) + fig, axs = plt.subplots(N_exps - 1, N_nodes + 1, squeeze=False, **kwargs) fig.tight_layout(pad=0.0) @@ -494,8 +496,8 @@ def plot_fitness(G, exp_list, P, measured_only=False, **kwargs): color=perturbation_colors, ) if iexp == N_exps - 1: - axs[iexp - 1, len(output_vars)].set_xticks(range(len(perturbation_vars))) - axs[iexp - 1, len(output_vars)].set_xticklabels( + axs[iexp - 1, plot_location)].set_xticks(range(len(perturbation_vars))) + axs[iexp - 1, plot_location].set_xticklabels( perturbation_vars, rotation=45 ) else: @@ -510,7 +512,6 @@ def plot_fitness(G, exp_list, P, measured_only=False, **kwargs): plt.show() - def collect_field_into_matrix(experiments, field_name="input"): """Collects the field_name values into matrix.