From 555c187e39f1b4d62e08625ccd7ec8a9e2389214 Mon Sep 17 00:00:00 2001 From: SimpleArt <71458112+SimpleArt@users.noreply.github.com> Date: Thu, 12 Nov 2020 10:06:27 -0500 Subject: [PATCH] Fixed yscale --- src/database/matplotlib_graph.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/database/matplotlib_graph.py b/src/database/matplotlib_graph.py index 6b9824e..c45e341 100644 --- a/src/database/matplotlib_graph.py +++ b/src/database/matplotlib_graph.py @@ -27,15 +27,13 @@ class Matplotlib_Graph: # Query for Y data Y_list = self.database.get_generation_total_fitness() - # Set the y scale - plt.yscale(self.yscale) - if(self.yscale == "log"): # If using log then the values have to be positive numbers Y = [abs(ele) for ele in Y_list] # Setup data plt.figure(figsize = self.size) + plt.yscale(self.yscale) self.type_of_plot(X,Y_list) # x and y labels @@ -62,15 +60,13 @@ class Matplotlib_Graph: # Query for Y data Y_list = self.database.get_highest_chromosome() - # Set the y scale - plt.yscale(self.yscale) - if(self.yscale == "log"): # If using log then the values have to be positive numbers Y = [abs(ele) for ele in Y_list] # Setup data plt.figure(figsize = self.size) + plt.yscale(self.yscale) self.type_of_plot(X,Y_list) # x and y labels @@ -96,15 +92,13 @@ class Matplotlib_Graph: # Query for Y data Y_list = self.database.get_lowest_chromosome() - # Set the y scale - plt.yscale(self.yscale) - if(self.yscale == "log"): # If using log then the values have to be positive numbers Y = [abs(ele) for ele in Y_list] # Setup data plt.figure(figsize = self.size) + plt.yscale(self.yscale) self.type_of_plot(X,Y_list) # x and y labels @@ -117,6 +111,7 @@ class Matplotlib_Graph: # Show the plot plt.show() + # Getter and setters @property def type_of_plot(self):