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


Python Plotter.Plotter類代碼示例

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


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

示例1: executeSimplePerceptron

def executeSimplePerceptron():
    #fileParser = FileParser("./workspaceFacu/RedesNeuronales-TP1/src/OCR/input_and_or.txt") #open from arguments
    fileParser = FileParser("./workspaceFacu/RedesNeuronales-TP1/src/OCR/input_ocr.txt") #open from arguments
    #fileParser = FileParser('./workspaceFacu/RedesNeuronales-TP1/src/OCR/input_test.txt') #open from arguments
    #fileParser = FileParser('./workspaceFacu/RedesNeuronales-TP1/src/OCR/input_test_with_testing_data.txt') #open from arguments
    #fileParser = FileParser('./workspaceFacu/RedesNeuronales-TP1/src/OCR/input_test_with_same_testing_data.txt') #open from arguments
    #fileParser = FileParser('./workspaceFacu/RedesNeuronales-TP1/src/OCR/input_martin.txt') #open from arguments
    parameters = fileParser.parseInputFile()
    
    #function = Exponential(0.5)
    #function = Identity()
    function = Sign()

    VERBOSE = True
    SHUFFLE_TRAINING_SET = True
    neuralAlgorithm = SimplePerceptron(parameters, function, not SHUFFLE_TRAINING_SET, VERBOSE)
    
    print 'ALGORITHM - Start'
    neuralAlgorithm.train()
    print 'ALGORITHM - Finish'
    
    trainingInformation = neuralAlgorithm.getTrainingInformation()

    errorFileName = './/..//graphics//error - ' + parameters.objective
    validationFileName = './/..//graphics//validation - ' + parameters.objective
    testingFileName = './/..//graphics//testing - ' + parameters.objective
    SAVE_TO_FILE = True
    SHOW = True
    plotter = Plotter(errorFileName, validationFileName, testingFileName, not SAVE_TO_FILE)
    plotter.plot(trainingInformation, SHOW)
開發者ID:mtqp,項目名稱:redes-neuronales-cammi-desousa,代碼行數:30,代碼來源:main.py

示例2: calculate

  def calculate(self, symbol=None):
    quotes_list = symbol.get_EoD_quotes(
        self.opts.get('fromdate'),
        self.opts.get('todate')
      )

    self.price_list = quotes_list

    Plotter.get_plot_buffer().append((self.name, self.price_list))

    return self
開發者ID:havellay,項目名稱:monitor,代碼行數:11,代碼來源:Attribute.py

示例3: visualizePredictions

    def visualizePredictions(self, training_x, training_y, test_x, test_y):
        #Input 1 or 2 D. Output 1 D.
        assert (training_x.shape[1] == 1 or training_x.shape[1] == 2), \
            "Invalid Dimensions for Plotting Results - Input: %d" %(training_x.shape[1])

        plotter = Plotter()
        plotter.plotPrediction(self, training_x, training_y, self.norm_test_x, self.norm_test_y)
        plotter.plotExpertsPrediction(self, test_x, test_y)
        plotter.plotExpertsCenters(self, training_x, training_y)
        plotter.plotGaussians(self, training_x, training_y)
開發者ID:fmaxgarcia,項目名稱:mixture_of_experts,代碼行數:10,代碼來源:MixtureOfExperts.py

示例4: getSignalOverBackground

def getSignalOverBackground(analysis,region,period,cut,**kwargs):
    doDataDriven = kwargs.pop('doDataDriven',True)
    scalefactor = kwargs.pop('scalefactor','event.gen_weight*event.pu_weight*event.lep_scale*event.trig_scale')

    nl = 3
    sigMap = getSigMap(nl)
    intLumiMap = getIntLumiMap()
    mergeDict = getMergeDict(period)
    channelBackground = getChannelBackgrounds(period)
    channels, leptons = getChannels(nl)
    saves = '%s_%s_%iTeV' % (analysis,region,period)
    ntuples = getNtupleDirectory(analysis,region,period)

    plotter = Plotter(region,ntupleDir=ntuples,saveDir=saves,period=period,rootName='plots_sOverB',mergeDict=mergeDict,scaleFactor=scalefactor,datadriven=doDataDriven)
    plotter.initializeBackgroundSamples([sigMap[period][x] for x in channelBackground[region+'datadriven' if doDataDriven else region]])
    plotter.initializeDataSamples([sigMap[period]['data']])
    plotter.setIntLumi(intLumiMap[period])

    sig = 0.
    sigErr2 = 0.
    bg = 0.
    bgErr2 = 0.
    for b in plotter.backgrounds:
        val, err = plotter.getNumEntries(cut,b,doError=True)
        if b=='WZJets':
            sig += val
            sigErr2 += err**2
        else:
            bg += val
            bgErr2 += err**2
    sigErr = sigErr2**0.5
    bgErr = bgErr2**0.5

    return sig/bg if bg else -1.
開發者ID:senka,項目名稱:InitialStateAnalysis,代碼行數:34,代碼來源:plotterFunctions.py

示例5: __init__

    def __init__(self,image,plotfile,plotarea,shadescale):
        Plotter.__init__(self,plotfile)

        # set up
        self.plotarea = plotarea
        self.spacing = 5
        self.image = image
        self.scaleImage()
      
        shadelevels = self.detectShades(shadescale)
        print "auto leveled for ", shadescale, " to ", shadelevels
        self.shades = { MODES.EW: (0,int(shadelevels[0])),  #70
           MODES.NS: (0,int(shadelevels[1])), #100
           MODES.NWSE: (0,int(shadelevels[2])), #150
           MODES.NESW: (0,int(shadelevels[3]))} #195
開發者ID:sparamona,項目名稱:vplotter,代碼行數:15,代碼來源:Img2PlotXY.py

示例6: __init__

 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
開發者ID:FlorianFetzer,項目名稱:PyPlotter,代碼行數:34,代碼來源:diag_prog.py

示例7: __init__

 def __init__(self, parent):
     '''
     Constructor
     '''
     self.parent = parent
     self.portfolioManager = PortfolioManager()
     self.plotter = Plotter(parent)
開發者ID:cesar0094,項目名稱:EfficientFrontier,代碼行數:7,代碼來源:InteractiveEPF.py

示例8: getYieldsErrors

def getYieldsErrors(analysis,region,period,cut,**kwargs):
    doDataDriven = kwargs.pop('doDataDriven',True)
    scalefactor = kwargs.pop('scalefactor','event.gen_weight*event.pu_weight*event.lep_scale*event.trig_scale')

    nl = 3
    sigMap = getSigMap(nl)
    intLumiMap = getIntLumiMap()
    mergeDict = getMergeDict(period)
    channelBackground = getChannelBackgrounds(period)
    channels, leptons = getChannels(nl)
    saves = '%s_%s_%iTeV' % (analysis,region,period)
    ntuples = getNtupleDirectory(analysis,region,period)

    plotter = Plotter(region,ntupleDir=ntuples,saveDir=saves,period=period,rootName='plots_statUnc',mergeDict=mergeDict,scaleFactor=scalefactor,datadriven=doDataDriven)
    plotter.initializeBackgroundSamples([sigMap[period][x] for x in channelBackground[region+'datadriven' if doDataDriven else region]])
    plotter.initializeDataSamples([sigMap[period]['data']])
    plotter.setIntLumi(intLumiMap[period])

    yields = {}
    for chan in ['eee','eem','mme','mmm']:
        yields[chan] = {}
        chanCut = '{0} && channel=="{1}"'.format(cut,chan)
        sig = 0.
        sigErr2 = 0.
        bg = 0.
        bgErr2 = 0.
        for b in plotter.backgrounds:
            val, err = plotter.getNumEntries(chanCut,b,doError=True)
            if b=='WZJets':
                sig += val
                sigErr2 += err**2
            else:
                bg += val
                bgErr2 += err**2
        sigErr = sigErr2**0.5
        bgErr = bgErr2**0.5

        data, dataErr = plotter.getDataEntries(chanCut,doError=True)
        dataErr2 = dataErr**2

        yields[chan]['sig'] = [sig, sigErr]
        yields[chan]['bg'] = [bg, bgErr]
        yields[chan]['data'] = [data, dataErr]

    yields['wz'] = {}
    for i in ['sig','bg','data']:
        tot = sum([yields[chan][i][0] for chan in ['eee','eem','mme','mmm']])
        totErr = sum([yields[chan][i][1]**2 for chan in ['eee','eem','mme','mmm']])**0.5
        yields['wz'][i] = [tot, totErr]

    return yields
開發者ID:senka,項目名稱:InitialStateAnalysis,代碼行數:51,代碼來源:plotterFunctions.py

示例9: main

def main():
    plotter = Plotter("out.png", "The plot", "some", "thing", 10, 60)
    plotter.addPlotItem("Source1", "#F01020", dataSource1)
    plotter.addPlotItem("Source2", "#201020", dataSource2)
    #plotter.begin()
    stopEvent = threading.Event()
    
    tweeter = TwitterPlotBot('api/app key', 'api/app secret',
                             'access key', 
                             'access secret',
                             '#pause', '#resume', plotter, stopEvent, '@navin_bhaskar', 500, False)
    time.sleep(120)
    print "Plotting..."
    tweeter.start()
    time.sleep(1900)
    print "Stopping it....."
    stopEvent.set()
    tweeter.join()
開發者ID:navin-bhaskar,項目名稱:TwitterPlotBot,代碼行數:18,代碼來源:TwitterPlotBot.py

示例10: getBackgroundEstimation

def getBackgroundEstimation(analysis,region,period,cut,**kwargs):
    doDataDriven = kwargs.pop('doDataDriven',True)
    scalefactor = kwargs.pop('scalefactor','event.gen_weight*event.pu_weight*event.lep_scale*event.trig_scale')

    nl = 3
    sigMap = getSigMap(nl)
    intLumiMap = getIntLumiMap()
    mergeDict = getMergeDict(period)
    channelBackground = getChannelBackgrounds(period)
    channels, leptons = getChannels(nl)
    saves = '%s_%s_%iTeV' % (analysis,region,period)
    ntuples = getNtupleDirectory(analysis,region,period)

    bgChannels = [sigMap[period][x] for x in channelBackground[region+'datadriven' if doDataDriven else region]]

    plotter = Plotter(region,ntupleDir=ntuples,saveDir=saves,period=period,rootName='plots_bgEstimation',mergeDict=mergeDict,scaleFactor=scalefactor,datadriven=doDataDriven)
    plotter.initializeBackgroundSamples(bgChannels)
    plotter.initializeDataSamples([sigMap[period]['data']])
    plotter.setIntLumi(intLumiMap[period])

    estimates = {}
    for chan in channels:
        thisCut = '{0} && channel=="{1}"'.format(cut,chan)
        estimates[chan] = {}
        obs, obsErr = plotter.getDataEntries(thisCut,doError=True)
        obsErr2 = obsErr**2
        dd = 0.
        ddErr2 = 0.
        mc = 0.
        mcErr2 = 0.
        for bg in bgChannels + ['datadriven']:
            val, err = plotter.getNumEntries(thisCut,bg,doError=True)
            if bg in ['datadriven']:
                dd += val
                ddErr2 += err**2
            else:
                mc += val
                mcErr2 += err**2
        fromMC = [obs - mc, (obsErr2 + mcErr2)**0.5]
        fromDD = [dd, ddErr2**0.5]
        estimates[chan]['mc'] = fromMC
        estimates[chan]['datadriven'] = fromDD

    estimates['total'] = {}
    estimates['total']['mc'] = [sum([estimates[x]['mc'][0] for x in channels]), sum([estimates[x]['mc'][1]**2 for x in channels])**0.5]
    estimates['total']['datadriven'] = [sum([estimates[x]['datadriven'][0] for x in channels]), sum([estimates[x]['datadriven'][1]**2 for x in channels])**0.5]

    return estimates
開發者ID:senka,項目名稱:InitialStateAnalysis,代碼行數:48,代碼來源:plotterFunctions.py

示例11: __init__

 def __init__(self):
     plott = Plotter()
     QtGui.QMainWindow.__init__(self)
     self.setWindowIcon(QtGui.QIcon('phyton.ico'))
     self.setupUi(self)
     self.fit = Fitter()
     self.gen = Generator()
     self.plot = Plotter()
     self.fitted_args = []
     self.chi2 = None
     self.chi2Error = 0.5
開發者ID:paweus,項目名稱:pite,代碼行數:11,代碼來源:Ui.py

示例12: __init__

 def __init__(self):
     QtGui.QMainWindow.__init__(self)
     self.plotHolder = Plotter()
     self.layout = QtGui.QVBoxLayout()
     self.data = 0
     self.dataStr = 0
     self.filePath = None
     self.filePath2 = 0
     self.setWindowTitle("FlightMadness")
     self.setWindowIcon(QtGui.QIcon('phyton.ico'))
     self.setupUi(self)
開發者ID:paweus,項目名稱:pite,代碼行數:11,代碼來源:UI.py

示例13: initialize

    def initialize(self):
        self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
        self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
        self.setWidgetResizable(True)

        self.widget = QtGui.QWidget()
        self.setWidget(self.widget)

        self.vbox = QtGui.QVBoxLayout()
        self.vbox.setSpacing(15)

        self.accel = Plotter('Beschleunigung', [-20, 20], 3, ['g', 'r', 'y'])
        self.gyro = Plotter('Gyroskop', [-360, 360], 3, ['g', 'r', 'y'])
        self.parser = Parser()
        self.current_file = Testfile('')

        self.vbox.addWidget(self.accel)
        self.vbox.setAlignment(self.accel, QtCore.Qt.AlignTop)
        self.vbox.addWidget(self.gyro)
        self.vbox.setAlignment(self.gyro, QtCore.Qt.AlignTop)
        self.vbox.addStretch()

        self.widget.setLayout(self.vbox)
開發者ID:AndreaBittner,項目名稱:ue-ei,代碼行數:23,代碼來源:Presenter.py

示例14: main

def main():
    """ This is the enrty point for our application,
    "TwitterBot" """
    global plotter
    plotter = Plotter(config.config["output file"], # The output file name
                      config.config["title"],  # Title of the plot
                      config.config["xlabel"], # X axis label
                      config.config["ylabel"], # Y axis label
                      config.config["samples"], # Max number of samples to be taken
                      config.config["Log Interval"], # Log interval
                      )
                      
    # Now that we have the plotter, it is time to add items to it
    for callback in CallBacks.callbacks:
        plotter.addPlotItem(callback[0], callback[2], callback[1])
    
    

    twitterBot = TwitterPlotBot(config.config["consumer key"],
                                config.config["consumer secret"],
                                config.config["access token"],
                                config.config["access token secret"],
                                config.config["stop plot cmd"],
                                config.config["resume plot cmd"],
                                plotter,
                                stopEvent,
                                config.config["screen id"],
                                config.config["Tweet Interval"],
                                False)
    
    # Wait for some time until we have atleast one data point to plot
    time.sleep(config.config["Log Interval"])
    
    twitterBot.start()
    while True:
        pass
開發者ID:navin-bhaskar,項目名稱:TwitterPlotBot,代碼行數:36,代碼來源:TwitterBot.py

示例15: Plotter

'''
Created on 6 de abr de 2016

@author: manoe
'''
from Plotter import Plotter

if __name__ == '__main__':
    p = Plotter([2,2], [-3,1])
    print(p.valor(2))
    
開發者ID:cristianohaeng,項目名稱:teste5,代碼行數:10,代碼來源:rodar.py


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