Fixed variable names
This commit is contained in:
@ -30,11 +30,7 @@ class Matplotlib_Graph:
|
|||||||
def plot(self):
|
def plot(self):
|
||||||
"""Plot all the graph attributes"""
|
"""Plot all the graph attributes"""
|
||||||
|
|
||||||
if self.xlabel is not None: xlabel = self.xlabel
|
if self.yscale == "log":
|
||||||
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
|
# If using log then the values have to be positive numbers
|
||||||
self.y = [abs(ele) for ele in self.y]
|
self.y = [abs(ele) for ele in self.y]
|
||||||
|
|
||||||
@ -44,9 +40,9 @@ class Matplotlib_Graph:
|
|||||||
self.type_of_plot(self.x, self.y)
|
self.type_of_plot(self.x, self.y)
|
||||||
|
|
||||||
# labels
|
# labels
|
||||||
if self.xlabel is not None: xlabel = self.xlabel
|
#if self.xlabel is not None: xlabel = self.xlabel
|
||||||
if self.ylabel is not None: xlabel = self.ylabel
|
#if self.ylabel is not None: xlabel = self.ylabel
|
||||||
if self.title is not None: xlabel = self.title
|
#if self.title is not None: xlabel = self.title
|
||||||
|
|
||||||
# Show the plot
|
# Show the plot
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|||||||
@ -11,4 +11,4 @@ ga.generation_goal = 150
|
|||||||
|
|
||||||
ga.evolve()
|
ga.evolve()
|
||||||
|
|
||||||
ga.graph.highest_value_chromosome()
|
ga.graph.generation_total_fitness()
|
||||||
|
|||||||
Reference in New Issue
Block a user