From 401c09d0b430f4a212c9bc9ecd3f0612b8d1a461 Mon Sep 17 00:00:00 2001 From: Sebastian Wehling-Benatelli Date: Wed, 4 Feb 2015 14:49:49 +0100 Subject: [PATCH] added new methods to the MPLWidget class to control the axes labels --- pylot/core/util/widgets.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index b361b8ed..76e25376 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -53,10 +53,21 @@ class MPLWidget(FigureCanvas): self.canvas = FigureCanvas(self.figure) self.axes = self.figure.add_subplot(111) - self.axes.set_xlabel(xlabel) - self.axes.set_ylabel(ylabel) - self.axes.set_title(title) + self.updateWidget(xlabel, ylabel, title) + def updateXLabel(self, text): + self.axes.set_xlabel(text) + + def updateYLabel(self, text): + self.axes.set_ylabel(text) + + def updateTitle(self, text): + self.axes.set_title(text) + + def updateWidget(self, xlabel, ylabel, title): + self.updateXLabel(xlabel) + self.updateYLabel(ylabel) + self.updateTitle(title) class PickDlg(QDialog):