From 0429c3756c6cd9381d908e33999c40472026487a Mon Sep 17 00:00:00 2001 From: danielwilczak101 <44122838+danielwilczak101@users.noreply.github.com> Date: Thu, 12 Nov 2020 16:41:12 -0500 Subject: [PATCH] Fixed x,y,title labels --- src/database/matplotlib_graph.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/database/matplotlib_graph.py b/src/database/matplotlib_graph.py index 8724d30..0e8680c 100644 --- a/src/database/matplotlib_graph.py +++ b/src/database/matplotlib_graph.py @@ -30,6 +30,8 @@ class Matplotlib_Graph: def plot(self): """Plot all the graph attributes""" + + if self.yscale == "log": # If using log then the values have to be positive numbers self.y = [abs(ele) for ele in self.y] @@ -40,9 +42,9 @@ class Matplotlib_Graph: self.type_of_plot(self.x, self.y) # labels - plt.xlabel(self.xlabel) - plt.ylabel(self.ylabel) - plt.title(self.title) + 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 # Show the plot plt.show()