Fixed yscale
This commit is contained in:
@ -27,15 +27,13 @@ class Matplotlib_Graph:
|
|||||||
# Query for Y data
|
# Query for Y data
|
||||||
Y_list = self.database.get_generation_total_fitness()
|
Y_list = self.database.get_generation_total_fitness()
|
||||||
|
|
||||||
# Set the y scale
|
|
||||||
plt.yscale(self.yscale)
|
|
||||||
|
|
||||||
if(self.yscale == "log"):
|
if(self.yscale == "log"):
|
||||||
# If using log then the values have to be positive numbers
|
# If using log then the values have to be positive numbers
|
||||||
Y = [abs(ele) for ele in Y_list]
|
Y = [abs(ele) for ele in Y_list]
|
||||||
|
|
||||||
# Setup data
|
# Setup data
|
||||||
plt.figure(figsize = self.size)
|
plt.figure(figsize = self.size)
|
||||||
|
plt.yscale(self.yscale)
|
||||||
self.type_of_plot(X,Y_list)
|
self.type_of_plot(X,Y_list)
|
||||||
|
|
||||||
# x and y labels
|
# x and y labels
|
||||||
@ -62,15 +60,13 @@ class Matplotlib_Graph:
|
|||||||
# Query for Y data
|
# Query for Y data
|
||||||
Y_list = self.database.get_highest_chromosome()
|
Y_list = self.database.get_highest_chromosome()
|
||||||
|
|
||||||
# Set the y scale
|
|
||||||
plt.yscale(self.yscale)
|
|
||||||
|
|
||||||
if(self.yscale == "log"):
|
if(self.yscale == "log"):
|
||||||
# If using log then the values have to be positive numbers
|
# If using log then the values have to be positive numbers
|
||||||
Y = [abs(ele) for ele in Y_list]
|
Y = [abs(ele) for ele in Y_list]
|
||||||
|
|
||||||
# Setup data
|
# Setup data
|
||||||
plt.figure(figsize = self.size)
|
plt.figure(figsize = self.size)
|
||||||
|
plt.yscale(self.yscale)
|
||||||
self.type_of_plot(X,Y_list)
|
self.type_of_plot(X,Y_list)
|
||||||
|
|
||||||
# x and y labels
|
# x and y labels
|
||||||
@ -96,15 +92,13 @@ class Matplotlib_Graph:
|
|||||||
# Query for Y data
|
# Query for Y data
|
||||||
Y_list = self.database.get_lowest_chromosome()
|
Y_list = self.database.get_lowest_chromosome()
|
||||||
|
|
||||||
# Set the y scale
|
|
||||||
plt.yscale(self.yscale)
|
|
||||||
|
|
||||||
if(self.yscale == "log"):
|
if(self.yscale == "log"):
|
||||||
# If using log then the values have to be positive numbers
|
# If using log then the values have to be positive numbers
|
||||||
Y = [abs(ele) for ele in Y_list]
|
Y = [abs(ele) for ele in Y_list]
|
||||||
|
|
||||||
# Setup data
|
# Setup data
|
||||||
plt.figure(figsize = self.size)
|
plt.figure(figsize = self.size)
|
||||||
|
plt.yscale(self.yscale)
|
||||||
self.type_of_plot(X,Y_list)
|
self.type_of_plot(X,Y_list)
|
||||||
|
|
||||||
# x and y labels
|
# x and y labels
|
||||||
@ -117,6 +111,7 @@ class Matplotlib_Graph:
|
|||||||
# Show the plot
|
# Show the plot
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
# Getter and setters
|
# Getter and setters
|
||||||
@property
|
@property
|
||||||
def type_of_plot(self):
|
def type_of_plot(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user