コード例 #1
0
 def handleOpen(self,event=None):
     print 'handleOpen'
     fobj = tkFileDialog.askopenfile( parent=self.root, mode='rU', title='Choose a data file' )
     import readfile
     self.data=readfile.toList(fobj)
     self.plotData()
     return
コード例 #2
0
 def handleCmd3(self):
     print 'handling command 3'
     import matplotlib.pyplot as plt
     fobj = tkFileDialog.askopenfile( parent=self.root, mode='rU', title='Choose a data file to display' )
     import average
     import readfile
     self.data=readfile.toList(fobj)
     self.plotDataMean()
     return
コード例 #3
0
 def handleCmd1(self):
     print 'handling command 1'
     fobj = tkFileDialog.askopenfile( parent=self.root, mode='rU', title='Choose a data file to display' )
     import average
     import readfile
     self.data=readfile.toList(fobj)
     data_array=average.getDataOnly(self.data)
     print "data arary is:"
     print data_array
     
     pylab.ion()
     pylab.hist(data_array)
     pylab.show()
     return
コード例 #4
0
 def handleCmd2(self):
     print 'handling command 2'
     import matplotlib.pyplot as plt
     fobj = tkFileDialog.askopenfile( parent=self.root, mode='rU', title='Choose a data file to display' )
     import average
     import readfile
     self.data=readfile.toList(fobj)
     width=0.2
     data_array=average.getDataOnly(self.data)
     tag=average.getSchool(self.data)
     ind=numpy.arange(len(data_array))
     fig=plt.figure()
     ax = fig.add_subplot(111)
     rects1 = ax.bar(ind, data_array, width, color='r')
     ax.set_ylabel('$')
     ax.set_title('Instruction-total for each school')
     ax.set_xticks(ind+width)
     ax.set_xticklabels(tag)
     print tag
     plt.show()