Override label variables with attributes
This commit is contained in:
@ -23,6 +23,10 @@ class Matplotlib_Graph:
|
|||||||
def plt_setup(self, X, Y, yscale, xlabel, ylabel, title, type_of_plot, size):
|
def plt_setup(self, X, Y, yscale, xlabel, ylabel, title, type_of_plot, size):
|
||||||
"""Setup for plt"""
|
"""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 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]
|
Y = [abs(ele) for ele in Y]
|
||||||
@ -85,10 +89,6 @@ class Matplotlib_Graph:
|
|||||||
# Query for Y data
|
# Query for Y data
|
||||||
Y = self.database.get_lowest_chromosome()
|
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)
|
self.plt_setup(X, Y, self.yscale, 'Generation', 'Lowest Fitness', 'Relationship Between Generations and Lowest Fitness', self.type_of_plot, self.size)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user