当前位置: 首页>>代码示例>>Python>>正文


Python cm.jet函数代码示例

本文整理汇总了Python中matplotlib.cm.jet函数的典型用法代码示例。如果您正苦于以下问题:Python jet函数的具体用法?Python jet怎么用?Python jet使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了jet函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: plot_coverage

def plot_coverage(counts, offset_x=0, frags_pos=None, frags_pos_out=None,
                  title=None):
    '''Plot the coverage and the minor allele frequency'''
    cov = counts.sum(axis=1)
    cov_tot = cov.sum(axis=0)

    fig, ax = plt.subplots(1, 1, figsize=(11, 8))
    ax.plot(np.arange(len(cov_tot.T)) + offset_x, cov_tot.T, lw=2, c='k',
            label=read_types)
    ax.set_xlabel('Position [bases]')
    ax.set_ylabel('Coverage')
    ax.grid(True)

    # If the fragments positions are marked, plot them
    # Inner primers
    if frags_pos is not None:
        for i, frag_pos in enumerate(frags_pos.T):
            ax.plot(frag_pos + offset_x, 2 * [(0.97 - 0.03 * (i % 2)) * ax.get_ylim()[1]],
                    c=cm.jet(int(255.0 * i / len(frags_pos.T))), lw=2)

    # Outer primers
    if frags_pos_out is not None:
        for i, frag_pos in enumerate(frags_pos_out.T):
            ax.plot(frag_pos + offset_x, 2 * [(0.96 - 0.03 * (i % 2)) * ax.get_ylim()[1]],
                    c=cm.jet(int(255.0 * i / len(frags_pos_out.T))), lw=2)

    ax.set_xlim(0, 10000)

    if title is not None:
        ax.set_title(title, fontsize=18)

    plt.tight_layout(rect=(0, 0, 1, 0.95)) 
开发者ID:iosonofabio,项目名称:hivwholeseq,代码行数:32,代码来源:check_premapped_coverage.py

示例2: findModDepths

    def findModDepths(self):
        oldtext = self.setButtonWait( self.findModDepthsPushButton )

        self.imageview.M_ex_rects = []
        self.imageview.M_em_rects = []
        self.imageview.phase_ex_rects = []
        self.imageview.phase_em_rects = []
        self.m.find_modulation_depths_and_phases()
        for s in self.m.validspots:
            color = cm.jet(s.M_ex)
            r = Rectangle( (s.coords[0],s.coords[1]), s.width, s.height, \
                               facecolor=color, edgecolor=color, alpha=1, zorder=7 )
            self.imageview.M_ex_rects.append( r )
            color = cm.jet(s.M_em)
            r = Rectangle( (s.coords[0],s.coords[1]), s.width, s.height, \
                               facecolor=color, edgecolor=color, alpha=1, zorder=7 )
            self.imageview.M_em_rects.append( r )
            color = cm.jet(s.phase_ex/np.pi+.5)
            r = Rectangle( (s.coords[0],s.coords[1]), s.width, s.height, \
                               facecolor=color, edgecolor=color, alpha=1, zorder=7 )
            self.imageview.phase_ex_rects.append( r )
            color = cm.jet(s.phase_em/np.pi+.5)
            r = Rectangle( (s.coords[0],s.coords[1]), s.width, s.height, \
                               facecolor=color, edgecolor=color, alpha=1, zorder=7 )
            self.imageview.phase_em_rects.append( r )
#            self.imageview.axes.add_patch( self.imageview.spot_rects[-1] )
#        self.imageview.show_stuff( what='M_ex' )
        self.imageview.show_stuff(what='M_ex')
        self.showStuffComboBox.setCurrentIndex(1)

        self.unsetButtonWait( self.findModDepthsPushButton, oldtext)
开发者ID:kiwimatto,项目名称:2dpolim-analysis,代码行数:31,代码来源:2dgui_logic.py

示例3: makePriorGrid

def makePriorGrid(zs,rs,dr,outfile,rmin=15,rmax=30):
    rMids = np.arange(16.,28.,0.1)
    drs = 0.5*np.ones(len(rMids))
    drs[rMids<23]=0.5
    drs[rMids<20]=1.0
    drs[rMids<19]=2.0
    zEdges=np.arange(-0.075,5.075,0.1)
    zMids = (zEdges[1:]+zEdges[:-1])/2.
    allH = []
    for i in range(len(rMids)):
        #print(rMids[i])
        rMsk = np.ma.masked_outside(rs,rMids[i]-dr,rMids[i]+dr)
        zMsk = np.ma.masked_array(zs,mask=np.ma.getmask(rMsk)).compressed()

        h = np.histogram(zMsk,bins=zEdges)[0]
        kernel=np.ones(5)*(1./5.)
        h2=sig.convolve(h,kernel,mode='same')
        h3=sig.convolve(h2,kernel,mode='same')
        g = interp1d(zMids,h3,bounds_error=False, fill_value=0.0)
        tot = integrate.quad(g,0.,7.)
        h3 = h3/tot[0]
        
        if i%5==0:
            plt.plot(zMids,h3,lw=3,alpha=0.75,color=cm.jet(i/len(rMids)),label='r='+str(rMids[i]))
        else:
            plt.plot(zMids,h3,lw=3,alpha=0.5,color=cm.jet(i/len(rMids)))
        allH.append(h3)
    return([rMids,zMids,np.array(allH)])
开发者ID:anazalea,项目名称:PySEDFit,代码行数:28,代码来源:zPrior.py

示例4: compSystems

def compSystems(workflow, systems):

    subprocesses = {}
    for system in systems:
        subprocesses[system] = open(
            "C:/cygwin64/home/jrayner/run2/scripts/benchmarking/" + system + workflow, "r"
        )  # open file containt subprocesses

    subprocessNames = {}
    subprocessTimeTaken = {}
    subprocessCompleteTime = {}
    for key in subprocesses:
        rawData = [line.strip().split() for line in subprocesses[key]]
        rawData = np.array(rawData)  # read subplocesses in to numpy array
        times = np.array(rawData[:, 0], dtype=np.float)
        subprocessNames[key] = np.array(rawData[:, 1])
        subprocessTimeTaken[key] = np.array(times) / 60  # read time column into its own array and convert to float
        for i in range(len(times)):
            times[i] = np.sum(times[max([0, i - 1]) : i + 1])  # generate clumaltive time for ploting ticks
        subprocessCompleteTime[key] = times
        subprocesses[key].close()

    lenth = len(subprocessNames[system])
    fig = plt.figure()
    fig2 = plt.figure()
    fig.suptitle(workflow)
    fig2.suptitle(workflow)
    x3 = fig.add_subplot(111)  # plot subprocesses data
    x1 = fig2.add_subplot(111)
    barwidth = 0.5 / len(systems)
    for i, system in enumerate(systems):
        totaltime = np.sum(subprocessTimeTaken[system] / 60)
        x3.bar(
            np.arange(lenth) + barwidth * i,
            subprocessTimeTaken[system] / 60,
            width=barwidth,
            color=cm.jet(1.0 * i / len(systems)),
            label=system,
        )
        x1.bar(
            np.arange(lenth) + barwidth * i,
            subprocessTimeTaken[system] / totaltime / 60,
            width=barwidth,
            color=cm.jet(1.0 * i / len(systems)),
            label=system,
        )
    x3.set_xticks(np.arange(lenth) + 0.25)
    x3.set_xticklabels(subprocessNames[system], rotation=90)
    print(subprocessNames[system])
    x3.set_ylabel("time (minutes)")
    x3.legend(loc="center left", bbox_to_anchor=(1, 0.5))
    x1.set_xticks(np.arange(lenth + 0.25))
    x1.set_xticklabels(subprocessNames[system], rotation=90)
    x1.set_ylabel("time %")
    x1.legend(loc="center left", bbox_to_anchor=(1, 0.5))

    plt.show()
开发者ID:JacR27,项目名称:benchplotting,代码行数:57,代码来源:TimeSummeryPlot.py

示例5: plot_propagator_theory

def plot_propagator_theory(xis, t, model='BSC', xlim=[0.03, 0.93], ax=None, logit=False,
                           VERBOSE=0, n=100):
    '''Make and plot BSC propagators for some initial frequencies'''
    from itertools import izip
    from hivwholeseq.theory.propagators import propagator_BSC, propagator_neutral

    if model == 'BSC':
        propagator_fun =  propagator_BSC
    elif model in ('neutral', 'Kingman', 'Kimura'):
        propagator_fun =  lambda x, y: propagator_neutral(x, y, n=n)

    if VERBOSE >= 1:
        print 'Make the propagators'
    xfs = []
    rhos = []
    for i, xi in enumerate(xis): 
        (xf, rho) = propagator_fun(xi, t)
        xfs.append(xf)
        rhos.append(rho)

    if VERBOSE >= 1:
        print 'Plot'
    if ax is None:
        ax_was_none = True
        fig, ax = plt.subplots(figsize=(12, 8))
    else:
        ax_was_none = False

    for i, (xi, xf, rho) in enumerate(izip(xis, xfs, rhos)):
        ind_out1 = (xf < xlim[0])
        ind_in = (xf >= xlim[0]) & (xf <= xlim[1])
        ind_out2 = (xf > xlim[1])
        ax.plot(xf[ind_in], rho[ind_in],
                color=cm.jet(1.0 * i / len(xis)),
                lw=2,
                label='$x_i = '+'{:1.1f}'.format(xi)+'$')
        ax.plot(xf[ind_out1], rho[ind_out1],
                color=cm.jet(1.0 * i / len(xis)),
                lw=2, ls='--', alpha=0.6)
        ax.plot(xf[ind_out2], rho[ind_out2],
                color=cm.jet(1.0 * i / len(xis)),
                lw=2, ls='--', alpha=0.6)

    if ax_was_none:
        ax.set_xlabel('Final frequency')

        if logit:
            ax.set_xlim(10**(-3.1), 1.0 - 10**(-3.1))
            ax.set_xscale('logit')
        else:
            ax.set_xscale('log')

        ax.set_ylim(1e-3, 1e3)
        ax.set_yscale('log')
        ax.set_ylabel('P(x1 | x0)')
        ax.set_title(model+' propagator, t = '+'{:1.1e}'.format(t))
        ax.grid(True)
开发者ID:iosonofabio,项目名称:hivwholeseq,代码行数:57,代码来源:get_propagator_allele_frequency.py

示例6: plot_dfcorrections

def plot_dfcorrections(plotfilename):
    niters= [1,2,3,4,5,10,15,20,25]
    bovy_plot.bovy_print(fig_height=7.,fig_width=8.)
    ii= 0
    # Load DF
    pyplot.subplot(2,1,1)
    dfc= dehnendf(beta=0.,correct=True,niter=niters[ii])
    bovy_plot.bovy_plot(dfc._corr._rs,
                        numpy.log(dfc._corr._corrections[:,0]),
                        '-',gcf=True,color=cm.jet(1.),lw=2.,zorder=1,
                        xrange=[0.,5.],
                        yrange=[-0.25,0.25],
                        ylabel=r'$\ln \Sigma_{\mathrm{out}}(R)-\ln\Sigma_{\mathrm{DF}}(R)$')
    linthresh= 0.0001
    pyplot.yscale('symlog',linthreshy=linthresh)
    for ii,niter in enumerate(niters[1:]):
        dfcn= dehnendf(beta=0.,correct=True,niter=niter)
        dfcp= dehnendf(beta=0.,correct=True,niter=niter-1)
        bovy_plot.bovy_plot(dfc._corr._rs,
                            numpy.log(dfcn._corr._corrections[:,0])-numpy.log(dfcp._corr._corrections[:,0]),
                            '-',overplot=True,
                            color=cm.jet(1.-(ii+1)/float(len(niters))),lw=2.,
                            zorder=ii+2)
    pyplot.fill_between(numpy.linspace(0.,5.,2.),
                        -linthresh*numpy.ones(2),
                         linthresh*numpy.ones(2),color='0.9',
                         zorder=0)
    bovy_plot.bovy_text(4.,-0.00008,r'$\mathrm{linear\ scale}$',
                        backgroundcolor='w',size=16.)
    pyplot.subplot(2,1,2)
    bovy_plot.bovy_plot(dfc._corr._rs,
                        0.5*numpy.log(dfc._corr._corrections[:,1]),
                        '-',gcf=True,color=cm.jet(1.),lw=2.,zorder=1,
                        xrange=[0.,5.],
                        yrange=[-0.25,0.25],
                        xlabel=r'$R/R_0$',
                        ylabel=r'$\ln \sigma_{R,\mathrm{out}}(R)-\ln\sigma_{R,\mathrm{DF}}(R)$')
    pyplot.yscale('symlog',linthreshy=linthresh)
    for ii,niter in enumerate(niters[1:]):
        dfcn= dehnendf(beta=0.,correct=True,niter=niter)
        dfcp= dehnendf(beta=0.,correct=True,niter=niter-1)
        bovy_plot.bovy_plot(dfc._corr._rs,
                            numpy.log(dfcn._corr._corrections[:,1])-numpy.log(dfcp._corr._corrections[:,1]),
                            '-',overplot=True,
                            color=cm.jet(1.-(ii+1)/float(len(niters))),lw=2.,
                            zorder=ii+2)
    pyplot.fill_between(numpy.linspace(0.,5.,2.),
                        -linthresh*numpy.ones(2),
                         linthresh*numpy.ones(2),color='0.9',
                         zorder=0)
    bovy_plot.bovy_text(4.,-0.00008,r'$\mathrm{linear\ scale}$',
                        backgroundcolor='w',size=16.)
    pyplot.tight_layout()
    bovy_plot.bovy_end_print(plotfilename)
    return None
开发者ID:jobovy,项目名称:galpy-paper-figures,代码行数:55,代码来源:figure22.py

示例7: create_figure

def create_figure(all_data): # takes in data and title and creates and saves plot

    width = 0.45  # width of the bars (in radians)

    # create the figure, dont change
    fig = plt.figure()
    ax = fig.add_subplot(111, polar=True)

    # angle positions, 0 to 360 with increments of 360/5
    xo = list(range(0, 360, 360 / 5))
    # Convert to radians and subtract half the width
    # of a bar to center it.
    x = [i * pi / 180 for i in xo]

    # set the labels for each bar, do not change
    ax.set_xticks(x)
    ax.set_xticklabels(['Military\nProwess', 'Productivity', 'Resource', 'Self-\nSufficiency', 'Morale'])
    ax.set_thetagrids(xo, frac=1.15) # frac changes distance of label from circumference of circle

    plt.ylim(0, 100) # sets range for radial grid

    fig.suptitle("India \n1993-2012", fontsize=20, y=0.5, x=0.1) # title of plot

    plt.rgrids([20, 40, 60, 80, 100], angle=33, fontsize=10) # the numbers you see along radius, angle changes position

    colorList = [];

    count = -1
    for key in all_data:
        count = count + 1
        data = all_data[key]
        mylist = [item+0.5*(count-len(all_data)/2)/len(all_data) for item in x]
        bars = ax.bar(mylist, data, width=width, align='center') # do the plotting
        i = 0
        for r, bar in zip(data, bars):
            bar.set_facecolor( cm.jet(0.8*count/len(all_data))) # set color for each bar, intensity proportional to height of bar
            colorList.append(cm.jet(0.8*count/len(all_data)))
            #bar.set_alpha(0.2) # make color partly transparent
            
            height = bar.get_height() # this is basically the radial height, or radius of bar

            # write value of each bar inside it
            # first param is angle, second is radius -10 makes it go inside the bar
        
            if i == 3 and count == 0:
                ax.text(mylist[i]-width/4*3, height+5, key, ha='center', va='center', fontsize=11)
            if i == 3 and count == len(all_data)-1:
                ax.text(mylist[i]+width/4*3, height-5, key, ha='center', va='center', fontsize=11)
            i = i + 1

    
    plt.savefig('examples/multiple.png')
开发者ID:aadra,项目名称:Global_power_index,代码行数:52,代码来源:multiple_vis.py

示例8: plotFunc

 def plotFunc(fig,axes):
     axes.set_xlabel('integration time (s)')
     axes.plot(intTimes,countStds,'k',label=r'total $\sigma$')
     axes.plot(intTimes,countSqrts,'k--',label=r'$\sqrt{med(N)}$')
     nBins = np.shape(spectrumStds)[1]
     for iBin in xrange(nBins):
         axes.plot(intTimes,spectrumStds[:,iBin],
             c=cm.jet((iBin+1.)/nBins),
             label=r'%d-%d $\AA$ $\sigma$'%(rebinnedWvlEdges[iBin],
             rebinnedWvlEdges[iBin+1]))
         axes.plot(intTimes,spectrumSqrts[:,iBin],
             c=cm.jet((iBin+1.)/nBins),linestyle='--')
     axes.legend(loc='upper left')
开发者ID:RupertDodkins,项目名称:ARCONS-pipeline-1,代码行数:13,代码来源:statsExplorer.py

示例9: plot_paddle_curve

def plot_paddle_curve(keys, inputfile, outputfile, format='png',
                      show_fig=False):
    """Plot curves from paddle log and save to outputfile.

    :param keys: a list of strings to be plotted, e.g. AvgCost
    :param inputfile: a file object for input
    :param outputfile: a file object for output
    :return: None
    """
    pass_pattern = r"Pass=([0-9]*)"
    test_pattern = r"Test samples=([0-9]*)"
    if not keys:
        keys = ['AvgCost']
    for k in keys:
        pass_pattern += r".*?%s=([0-9e\-\.]*)" % k
        test_pattern += r".*?%s=([0-9e\-\.]*)" % k
    data = []
    test_data = []
    compiled_pattern = re.compile(pass_pattern)
    compiled_test_pattern = re.compile(test_pattern)
    for line in inputfile:
        found = compiled_pattern.search(line)
        found_test = compiled_test_pattern.search(line)
        if found:
            data.append([float(x) for x in found.groups()])
        if found_test:
            test_data.append([float(x) for x in found_test.groups()])
    x = numpy.array(data)
    x_test = numpy.array(test_data)
    if x.shape[0] <= 0:
        sys.stderr.write("No data to plot. Exiting!\n")
        return
    m = len(keys) + 1
    for i in xrange(1, m):
        pyplot.plot(
            x[:, 0],
            x[:, i],
            color=cm.jet(1.0 * (i - 1) / (2 * m)),
            label=keys[i - 1])
        if (x_test.shape[0] > 0):
            pyplot.plot(
                x[:, 0],
                x_test[:, i],
                color=cm.jet(1.0 - 1.0 * (i - 1) / (2 * m)),
                label="Test " + keys[i - 1])
    pyplot.xlabel('number of epoch')
    pyplot.legend(loc='best')
    if show_fig:
        pyplot.show()
    pyplot.savefig(outputfile, bbox_inches='tight')
    pyplot.clf()
开发者ID:hiredd,项目名称:Paddle,代码行数:51,代码来源:plotcurve.py

示例10: plot_orient_location

def plot_orient_location(data,odata,tracks):
    import correlation as corr

    omask = np.isfinite(odata['orient'])
    goodtracks = np.array([78,95,191,203,322])

    ss = 22.

    pl.figure()
    for goodtrack in goodtracks:
        tmask = tracks == goodtrack
        fullmask = np.all(np.asarray(zip(omask,tmask)),axis=1)
        loc_start = (data['x'][fullmask][0],data['y'][fullmask][0])
        orient_start = odata['orient'][fullmask][0]
        sc = pl.scatter(
                (odata['orient'][fullmask] - orient_start + pi) % twopi,
                np.asarray(map(corr.get_norm,
                    zip([loc_start]*fullmask.sum(),
                        zip(data['x'][fullmask],data['y'][fullmask]))
                    ))/ss,
                #marker='*',
                label = 'track {}'.format(goodtrack),
                color = cm.jet(1.*goodtrack/max(tracks)))
                #color = cm.jet(1.*data['f'][fullmask]/1260.))
        print "track",goodtrack
    pl.legend()
    pl.show()
    return True
开发者ID:moji2289,项目名称:square-tracking,代码行数:28,代码来源:orientation.py

示例11: visualize_ns_old

 def visualize_ns_old(self, term, points=200):
     """
     Use randomly selected coordinates instead of most active
     """
     if term in self.no.term:
         term_index = self.no._ns['features_df'].columns.get_loc(term)
         rand_point_inds = np.random.random_integers(0, len(np.squeeze(zip(self.no._ns['mni_coords'].data))), points)
         rand_points = np.squeeze(zip(self.no._ns['mni_coords'].data))[rand_point_inds]
         weights = []
         inds_of_real_points_with_no_fucking_missing_study_ids = []
         for rand_point in range(len(rand_points)):
             if len(self.no.coord_to_ns_act(rand_points[rand_point].astype(list))) > 0:
                 inds_of_real_points_with_no_fucking_missing_study_ids.append(rand_point_inds[rand_point])
                 weights.append(self.no.coord_to_ns_act(rand_points[rand_point].astype(list))[term_index])
         fig = plt.figure()
         ax = fig.add_subplot(111, projection='3d')
         colors = cm.jet(weights/max(weights))
         color_map = cm.ScalarMappable(cmap=cm.jet)
         color_map.set_array(weights)
         fig.colorbar(color_map)
         x = self.no._ns['mni_coords'].data[inds_of_real_points_with_no_fucking_missing_study_ids, 0]
         y = self.no._ns['mni_coords'].data[inds_of_real_points_with_no_fucking_missing_study_ids, 1]
         z = self.no._ns['mni_coords'].data[inds_of_real_points_with_no_fucking_missing_study_ids, 2]
     else:
         raise ValueError('Term '+term + ' has not been initialized. '
                                         'Use get_ns_act(' + term + ')')
     ax.scatter(x, y, z, c=colors, alpha=0.4)
     ax.set_title('Estimation of ' + term)
开发者ID:ml-lab,项目名称:nsaba,代码行数:28,代码来源:visualizer.py

示例12: _cm_ra_plot

def _cm_ra_plot(data,headings,dates,ave_data,fig_num,colour_col,
             y_col,run_ave_points,n_plot_row,n_plot_col,n_plot_num):
    import numpy as np
    import matplotlib.pyplot as plt
    import matplotlib.cm as cm
    
    depth = np.max(data[:,colour_col]) - np.min(data[:,colour_col])
    c_map = cm.jet(np.arange(256))
    
    Z = [[0,0],[0,0]]
    levels = range(int(np.min(data[:,colour_col])),
                    int(np.max(data[:,colour_col])),1)
    mappl = plt.contourf(Z,levels,cmap=cm.jet)      
   
    plt.figure(fig_num)   
 
    plt.subplot(n_plot_row,n_plot_col,n_plot_num)
    for i in range(len(data)):
        plot1 = plt.plot(dates[i],data[i,y_col])
        cm_point = np.floor(((np.max(data[:,colour_col]) - 
                data[i,colour_col]) / depth) * 255)
        plt.setp(plot1,linestyle = 'none',marker = '.')
        plt.setp(plot1,color = c_map[255 - cm_point,])

    plt.grid(True)
    plt.ylabel('%s on %s'%(headings[colour_col],headings[y_col]))
#        plt.axis([None,None,0,100])
    plt.axis([None,None,min(data[:,y_col]),max(data[:,y_col])])
    plt.plot(dates,ave_data[:,y_col],'k-')
    locs, labels = plt.xticks()
    plt.setp(labels, rotation=0)
    plt.colorbar(mappl)
开发者ID:pdawsonsa,项目名称:RecoveryModels,代码行数:32,代码来源:PD.py

示例13: plot_orient_quiver

def plot_orient_quiver(data, odata, mask=None, imfile='', fps=1, savename='', figsize=None):
    """ plot_orient_quiver(data, odata, mask=None, imfile='')
    """
    import matplotlib.colors as mcolors
    import matplotlib.colorbar as mcolorbar
    pl.figure(tight_layout=False, figsize=figsize)
    if imfile is not None:
        bgimage = Im.open(extdir+prefix+'_0001.tif' if imfile is '' else imfile)
        pl.imshow(bgimage, cmap=cm.gray, origin='upper')
    #pl.quiver(X, Y, U, V, **kw)
    if mask is None:
        try:
            mask = np.all(np.isfinite(odata['orient']), axis=1)
        except ValueError:
            mask = np.isfinite(odata['orient'])

    n = odata.shape[-1] if odata.ndim > 1 else 1
    ndex = np.repeat(np.arange(mask.sum()), n)
    nz = mcolors.Normalize()
    nz.autoscale(data['f'][mask]/fps)
    qq = pl.quiver(
            data['y'][mask][ndex], data['x'][mask][ndex],
            odata['cdisp'][mask][...,1].flatten(), -odata['cdisp'][mask][...,0].flatten(),
            color=cm.jet(nz(data['f'][mask]/fps)),
            scale=1, scale_units='xy')
    #pl.title(', '.join(imfile.split('/')[-1].split('_')[:-1]) if imfile else '')
    cax,_ = mcolorbar.make_axes(pl.gca())
    cb = mcolorbar.ColorbarBase(cax, cmap=cm.jet, norm=nz)
    cb.set_label('time '+('(s)'if fps > 1 else '(frame)'))
    if savename:
        print "saving to", savename
        pl.savefig(savename)
    pl.show()
    return qq, cb
开发者ID:moji2289,项目名称:square-tracking,代码行数:34,代码来源:orientation.py

示例14: plot_m1m2

def plot_m1m2(m1m2_file, plot_pk=None, m1gr=None, m2gr=None, 
              m1gr_err=None, m2gr_err=None,
              m1m2_contour=None,
              pk_label_coord=None,
              xlim=None, ylim=None, plot_inset=False,
              colour=None, line_style=None, m1m2_pbdot_uncorr=None):

     
     n_plot = len(plot_pk)
# Ensure that we are plotting more than 1 parameter:
     if(n_plot < 1):
          print 'plot_m1m2:  Must plot at least one PK parameter. Exiting...'   
     if(colour == None):
          clr = [cm.jet(float(i_plot)/float(n_plot-1)) for i_plot in range(n_plot)]
     else:
          clr = colour
          
     if(line_style == None):
         line_style='-'
 
# Now, read input m1m2.dat-style file:     
     try:
          f_m1m2 = open(m1m2_file, 'r')
     except IOError as (errno, strerror):
          if (errno == 2):  # file not found
               print "IOError ({0}): File".format(errno), m1m2_file, "not found."
          else:
               print "IOError ({0}): {1}".format(errno, strerror)
          return
开发者ID:rferdman,项目名称:pypsr,代码行数:29,代码来源:psrplot.py

示例15: __init__

    def __init__(self, parent=None, data=None, fnameAbsPath="", enable=True, objectName=""):
        super(lines, self).__init__(parent, data, fnameAbsPath, enable, objectName, pgObject="PlotCurveItem")

        # Choose symbols from preferences file.
        # TODO: read symbols from GUI
        self.symbol = lasHelp.readPreference("symbolOrder")[0]
        self.symbolSize = int(self.parent.markerSize_spinBox.value())
        self.alpha = int(self.parent.markerAlpha_spinBox.value())
        self.lineWidth = int(self.parent.lineWidth_spinBox.value())

        # Add to the imageStackLayers_model which is associated with the points QTreeView
        name = QtGui.QStandardItem(objectName)
        name.setEditable(False)

        # Add checkbox
        thing = QtGui.QStandardItem()
        thing.setFlags(QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsEditable | QtCore.Qt.ItemIsUserCheckable)
        thing.setCheckState(QtCore.Qt.Checked)

        # self.modelItems=(name,thing) #Remove this for now because I have NO CLUE how to get access to the checkbox state
        self.modelItems = name
        self.model = self.parent.points_Model

        self.addToList()

        # Set the colour of the object based on how many items are already present
        number_of_colors = 6
        thisNumber = (self.parent.points_Model.rowCount() - 1) % number_of_colors
        cm_subsection = linspace(0, 1, number_of_colors)
        colors = [cm.jet(x) for x in cm_subsection]
        color = colors[thisNumber]
        self.color = [color[0] * 255, color[1] * 255, color[2] * 255]
开发者ID:raacampbell,项目名称:lasagna,代码行数:32,代码来源:lines.py


注:本文中的matplotlib.cm.jet函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。