From b0c4bd79c6b067616ef70ec97ac2add98f35c109 Mon Sep 17 00:00:00 2001 From: SimpleArt <71458112+SimpleArt@users.noreply.github.com> Date: Thu, 12 Nov 2020 16:24:57 -0500 Subject: [PATCH] Override label variables with attributes --- src/database/matplotlib_graph.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/database/matplotlib_graph.py b/src/database/matplotlib_graph.py index 5100858..74637da 100644 --- a/src/database/matplotlib_graph.py +++ b/src/database/matplotlib_graph.py @@ -23,6 +23,10 @@ class Matplotlib_Graph: def plt_setup(self, X, Y, yscale, xlabel, ylabel, title, type_of_plot, size): """Setup for plt""" + if self.xlabel is not None: xlabel = self.xlabel + if self.ylabel is not None: xlabel = self.ylabel + if self.title is not None: xlabel = self.title + if yscale == "log": # If using log then the values have to be positive numbers Y = [abs(ele) for ele in Y] @@ -85,10 +89,6 @@ class Matplotlib_Graph: # Query for Y data Y = self.database.get_lowest_chromosome() - if(self.yscale == "log"): - # If using log then the values have to be positive numbers - Y = [abs(ele) for ele in Y] - self.plt_setup(X, Y, self.yscale, 'Generation', 'Lowest Fitness', 'Relationship Between Generations and Lowest Fitness', self.type_of_plot, self.size)