Fixed x,y,title labels
This commit is contained in:
@ -30,6 +30,8 @@ class Matplotlib_Graph:
|
|||||||
def plot(self):
|
def plot(self):
|
||||||
"""Plot all the graph attributes"""
|
"""Plot all the graph attributes"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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
|
||||||
self.y = [abs(ele) for ele in self.y]
|
self.y = [abs(ele) for ele in self.y]
|
||||||
@ -40,9 +42,9 @@ class Matplotlib_Graph:
|
|||||||
self.type_of_plot(self.x, self.y)
|
self.type_of_plot(self.x, self.y)
|
||||||
|
|
||||||
# labels
|
# labels
|
||||||
plt.xlabel(self.xlabel)
|
if self.xlabel is not None: xlabel = self.xlabel
|
||||||
plt.ylabel(self.ylabel)
|
if self.ylabel is not None: xlabel = self.ylabel
|
||||||
plt.title(self.title)
|
if self.title is not None: xlabel = self.title
|
||||||
|
|
||||||
# Show the plot
|
# Show the plot
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|||||||
Reference in New Issue
Block a user