def drawGraph(self, *args):
'''
Method to draw the matplotlib graph
'''
self.graphFrame = Tk.Frame(self.root)
f = Figure(figsize=(7,5), dpi=100)
subplot = f.add_subplot(111)
if self.plotType == 'line':
#a.plot(self.xAxis, self.yData)
subplot.plot(self.falseX, self.yData)
elif self.plotType == 'bar':
subplot.bar(self.xAxis, self.yData)
subplot.set_title(self.Title.get())
subplot.set_xlabel(self.xLabel.get())
subplot.set_ylabel(self.yLabel.get())
subplot.set_ylim(self.yMin.get(), self.yMax.get())
subplot.set_xlim(self.xMin.get(), self.xMax.get())
#a.set_xticklabels( self.xTicLabel.get(), rotation = 45)
#a.set_xticklabels(map(str, self.xAxis), rotation = 45)
subplot.xticks(self.falseX, map(str, self.xAxis), rotation='vertical')
# a tk.DrawingArea
self.canvas = FigureCanvasTkAgg(f, master = self.graphFrame)
self.canvas.show()
self.canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
self.canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
self.graphFrame.grid(row=1, rowspan=10)
评论列表
文章目录