當前位置: 首頁>>代碼示例>>Python>>正文


Python Plotter.plot_eval方法代碼示例

本文整理匯總了Python中Plotter.Plotter.plot_eval方法的典型用法代碼示例。如果您正苦於以下問題:Python Plotter.plot_eval方法的具體用法?Python Plotter.plot_eval怎麽用?Python Plotter.plot_eval使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Plotter.Plotter的用法示例。


在下文中一共展示了Plotter.plot_eval方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: MeinDialog

# 需要導入模塊: from Plotter import Plotter [as 別名]
# 或者: from Plotter.Plotter import plot_eval [as 別名]
class MeinDialog(QtGui.QDialog, Dlg): 
    def __init__(self): 
        QtGui.QDialog.__init__(self) 
        self.setupUi(self)        
        self.datreader = DataReader()        
        self.Plotter = Plotter()
        self.directory = os.getcwd()
        self.WorkingD_label.setText(self.directory)
        
        self.ShowFile_PB.clicked.connect(self.show_file_start) # shows first lines in the textbrowser
        self.ReadSets_PB.clicked.connect(self.read_set) # reads all files that start with lineEdit and creates a dict in the Sets_Dict[set][file][column]
        self.PlotFile_PB.clicked.connect(self.plotfile)
        self.MAV_slider.valueChanged.connect(self.mav_valuechanged)
        self.MAV_slider.sliderReleased.connect(self.mav_released)
        self.LP_slider.sliderReleased.connect(self.lp)
        self.LP_slider.valueChanged.connect(self.lp_valuechanged)
        self.HP_slider.sliderReleased.connect(self.hp)
        self.HP_slider.valueChanged.connect(self.hp_valuechanged)
        #self.CutZeros.clicked.connect(self.cut_zeros_filedict)
        self.PlotColumn_PB.clicked.connect(self.plotcolumn)
        self.Clear_PB.clicked.connect(self.clear)
        self.Export_PB.clicked.connect(self.export)
        self.FFT_PB.clicked.connect(self.fft)
        self.ReadLabBook.clicked.connect(self.readlabbook)
        self.MAVEdit.returnPressed.connect(self.mav_released)
        self.MVAREdit.returnPressed.connect(self.mvar)
        self.MMMINEdit.returnPressed.connect(self.mmmin)
        self.Corr_PB.clicked.connect(self.correlate)
        self.Select_PB.clicked.connect(self.open_filedialog)  
        self.Pyro_PB.clicked.connect(self.read_pyro)
        self.Log_PB.clicked.connect(self.log_scale)
        
        self.Sets_Dict = dict() # contains [set1][file1][column1] - the data
        self.Files_Dict = dict() # contains [filename 1]: 'set-filename' 
        self.Columns_Dict = dict() # contains[set-filename-column]: same
        
    def log_scale(self):
        print 'log_scale'
        f = self.Plotter.figure_list[int(self.CurrentFigureEdit.text())]
        ax = f.axes[int(self.ax_scale_edit.text())]
        if ax.get_yscale == 'linear':
            ax.set_yscale('log')
            print 'log'
        else:
            ax.set_yscale('linear')
        plt.title('')
                
    def read_pyro(self):
        print 'read_pyro'
        filelist = list()
        filelist = [f for f in os.listdir(self.directory) if f.startswith(self.lineEdit.text())]
        print filelist
        filelist = [os.path.join(self.directory, f) for f in filelist]
        cols_of_interest = [str(c).rstrip(' ').lstrip(' ') for c in self.ColsOfInterestEdit.text().split(',')]
        print cols_of_interest
        self.Sets_Dict[str(self.lineEdit.text())] = self.datreader.read_pyro(filelist, cols_of_interest)
        #self.cut_zeros_filedict()
        self.update_SetScroll()
        self.update_Files_Dict() 
        self.update_FileScroll()
        self.update_Columns_Dict()
        self.update_ColumnScroll()
        print self.Sets_Dict.keys()
        
        
    def open_filedialog(self):
        files = str(QtGui.QFileDialog.getOpenFileName(None, QtCore.QString('Select File'), QtCore.QString(os.getcwd()),QtCore.QString('*.txt')))
        print files
        self.lineEdit.setText(os.path.basename(files))
        self.WorkingD_label.setText(os.path.dirname(files))
        self.directory = os.path.dirname(files)
        
    def correlate(self):
        fnum = self.Plotter.plot_eval(self.Plotter.correlate, 0, int(self.CurrentFigureEdit.text()), self.InActiveFigure.isChecked(), self.SelectedRange.isChecked(), self.SubtractMean_PB.isChecked())
        self.CurrentFigureEdit.setText(str(fnum))
        
    def readlabbook(self):
        #self.HistoryEdit.insertPlainText(self.HistoryEdit.text())
        print 'read labbook'
        lab_dict = self.datreader.get_labdict(str(self.lineEdit.text()))
        filelist = lab_dict.keys()
        print filelist
        path = self.directory
        filelist = [os.path.join(path, f) for f in filelist if f in os.listdir(path)]
        print filelist
        cols_of_interest = [str(c).rstrip(' ').lstrip(' ') for c in self.ColsOfInterestEdit.text().split(',')]
        print cols_of_interest
        self.Sets_Dict[str(self.lineEdit.text())] = self.datreader.read_files(filelist, cols_of_interest)
        #self.cut_zeros_filedict()
        lab_dict = self.datreader.get_labdict(str(self.lineEdit.text()))
        for f in self.Sets_Dict[str(self.lineEdit.text())].keys():
            for info in lab_dict[f].keys():
                self.Sets_Dict[str(self.lineEdit.text())][f][info] = lab_dict[f][info]
        self.update_SetScroll()
        self.update_Files_Dict() 
        self.update_FileScroll()
        self.update_Columns_Dict()
        self.update_ColumnScroll()
        print self.Sets_Dict.keys()
    
#.........這裏部分代碼省略.........
開發者ID:FlorianFetzer,項目名稱:PyPlotter,代碼行數:103,代碼來源:diag_prog.py


注:本文中的Plotter.Plotter.plot_eval方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。