• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python pylab.xticks函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: plot_rfs

def plot_rfs(size, C, Rx, Ry, color='b'):
    radius = np.sqrt(size[...]/np.pi)
    a, w = 0, C.shape[0]
    plt.scatter(Rx, Ry, s=15, color='w', edgecolor='k')
    plt.scatter(C[a:w, 1], C[a:w, 0], s=radius*500, alpha=0.4, color=color)
    plt.xticks([])
    plt.yticks([])
开发者ID:gdetor,项目名称:SI-RF-Structure,代码行数:7,代码来源:DNF-RF-Size.py


示例2: plot_grid_experiment_results

def plot_grid_experiment_results(grid_results, params, metrics):
    global plt
    params = sorted(params)
    grid_params = grid_results.grid_params
    plt.figure(figsize=(8, 6))
    for metric in metrics:
        grid_params_shape = [len(grid_params[k]) for k in sorted(grid_params.keys())]
        params_max_out = [(1 if k in params else 0) for k in sorted(grid_params.keys())]
        results = np.array([e.results.get(metric, 0) for e in grid_results.experiments])
        results = results.reshape(*grid_params_shape)
        for axis, included_in_params in enumerate(params_max_out):
            if not included_in_params:
                results = np.apply_along_axis(np.max, axis, results)

        print results
        params_shape = [len(grid_params[k]) for k in sorted(params)]
        results = results.reshape(*params_shape)

        if len(results.shape) == 1:
            results = results.reshape(-1,1)
        import matplotlib.pylab as plt

        #f.subplots_adjust(left=.2, right=0.95, bottom=0.15, top=0.95)
        plt.imshow(results, interpolation='nearest', cmap=plt.cm.hot)
        plt.title(str(grid_results.name) + " " + metric)

        if len(params) == 2:
            plt.xticks(np.arange(len(grid_params[params[1]])), grid_params[params[1]], rotation=45)
        plt.yticks(np.arange(len(grid_params[params[0]])), grid_params[params[0]])
        plt.colorbar()
        plt.show()
开发者ID:gmum,项目名称:mlls2015,代码行数:31,代码来源:utils.py


示例3: plot_confusion_matrix

def plot_confusion_matrix(cm, title='', cmap=plt.cm.Blues):
    #print cm
    #display vehicle, idle, walking accuracy respectively
    #display overall accuracy
    print type(cm)
   # plt.figure(index
    plt.imshow(cm, interpolation='nearest', cmap=cmap)
    #plt.figure("")
    plt.title("Confusion Matrix")
    plt.colorbar()
    tick_marks = [0,1,2]
    target_name = ["driving","idling","walking"]


    plt.xticks(tick_marks,target_name,rotation=45)

    plt.yticks(tick_marks,target_name,rotation=45)
    print len(cm[0])

    for i in range(0,3):
        for j in range(0,3):
         plt.text(i,j,str(cm[i,j]))
    plt.tight_layout()
    plt.ylabel("Actual Value")
    plt.xlabel("Predicted Outcome")
开发者ID:sb1989,项目名称:fyp,代码行数:25,代码来源:KNNClassifierAccuracy.py


示例4: plot_histogram

    def plot_histogram(self, main="", numrows=1, numcols=1, fignum=1):
        """Plot a histogram of choices and probability sums. Expects probabilities as (at least) a 2D array.
        """
        from matplotlib.pylab import bar, xticks, yticks, title, text, axis, figure, subplot

        probabilities = self.get_probabilities()
        if probabilities.ndim < 2:
            raise StandardError, "probabilities must have at least 2 dimensions."
        alts = probabilities.shape[1]
        width_par = (1 / alts + 1) / 2.0
        choice_counts = self.get_choice_histogram(0, alts)
        sum_probs = self.get_probabilities_sum()

        subplot(numrows, numcols, fignum)
        bar(arange(alts), choice_counts, width=width_par)
        bar(arange(alts) + width_par, sum_probs, width=width_par, color="g")
        xticks(arange(alts))
        title(main)
        Axis = axis()
        text(
            alts + 0.5,
            -0.1,
            "\nchoices histogram (blue),\nprobabilities sum (green)",
            horizontalalignment="right",
            verticalalignment="top",
        )
开发者ID:apdjustino,项目名称:DRCOG_Urbansim,代码行数:26,代码来源:upc_sequence.py


示例5: show_binary_images

def show_binary_images(samples, nsamples, d1, d2, nrows, ncols):
    """
    Plots samples in a NumPy 2D array ``samples`` as ``d1`` by ``d2`` images.
    (one sample per row of ``samples``).

    The samples are assumed to be images with binary pixels. The
    images are layed out in a ``nrows`` by ``ncols`` grid.
    """
    perm = range(nsamples)
    #random.shuffle(perm)
    if samples.shape[0] < nrows*ncols:
        samples_padded = numpy.zeros((nrows*ncols,samples.shape[1]))
        samples_padded[:samples.shape[0],:] = samples
        samples = samples_padded

    image = 0.5*numpy.ones((nrows*(d1+1)-1,ncols*(d2+1)-1),dtype=float)
    for i in range(nrows):
        for j in range(ncols):
            image[(i*d1+i):((i+1)*d1+i),(j*d2+j):((j+1)*d2+j)] = (1-samples[perm[i*ncols + j]].reshape(d1,d2))

    bordered_image = 0.5 * numpy.ones((nrows*(d1+1)+1,ncols*(d2+1)+1),dtype=float)

    bordered_image[1:nrows*(d1+1),1:ncols*(d2+1)] = image

    imshow(bordered_image,cmap = cm.Greys,interpolation='nearest')
    xticks([])
    yticks([])
开发者ID:goelhardik,项目名称:projects,代码行数:27,代码来源:visualize.py


示例6: plot

def plot(frame,dirname,clim=None,axis_limits=None):
    if not os.path.exists('./figures'):
        os.makedirs('./figures')
        
    try:
        sol=Solution(frame,file_format='petsc',read_aux=False,path='./saved_data/'+dirname+'/_p/',file_prefix='claw_p')
    except IOError:
        'Data file not found; please unzip the files in saved_data/.'
        return
    x=sol.state.grid.x.centers; y=sol.state.grid.y.centers
    mx=len(x); my=len(y)
    
    mp=sol.state.num_eqn    
    yy,xx = np.meshgrid(y,x)

    p=sol.state.q[0,:,:]
    if clim is not None:
        pl.pcolormesh(xx,yy,p,cmap=cm.RdBu_r)
    else:
        pl.pcolormesh(xx,yy,p,cmap=cm.Reds)
    pl.title("t= "+str(sol.state.t),fontsize=20)
    pl.xticks(size=20); pl.yticks(size=20)
    cb = pl.colorbar();

    if clim is not None:
        pl.clim(clim[0],clim[1]);
    imaxes = pl.gca(); pl.axes(cb.ax)
    pl.yticks(fontsize=20); pl.axes(imaxes)
    pl.axis('equal')
    if axis_limits is None:
        pl.axis([np.min(x),np.max(x),np.min(y),np.max(y)])
    else:
        pl.axis([axis_limits[0],axis_limits[1],axis_limits[2],axis_limits[3]])
    pl.savefig('./figures/'+dirname+'.png')
    pl.close()
开发者ID:ketch,项目名称:diffractons_RR,代码行数:35,代码来源:waves_2D_plots.py


示例7: algorithm_confidence_interval_figure

    def algorithm_confidence_interval_figure(
        self, trace_file, algorithm, data, x_aspect, y_aspect, x_title, y_title, title
    ):

        reversed_data = transposed(data)

        fig, ax = plt.subplots()
        ax.set_xlabel(x_title, fontsize=18)
        ax.set_ylabel(y_title, fontsize=18)
        ax.set_title(title + " (" + self.legend(algorithm) + ")")
        x = self.vms_scenarios
        ax.xaxis.set_ticks(x)
        pylab.xticks(x, self.vms_ticks(x), rotation="vertical", verticalalignment="top")

        ax = fig.gca()

        scenarios_series = []
        m_series = []
        upper_ci_series = []
        lower_ci_series = []
        vms_series = []

        plt.grid(True)
        for scenario in reversed_data:
            x_serie = []
            y_serie = []
            x = int(scenario[0][x_aspect])

            for repetition in scenario:
                y = float(repetition[y_aspect])
                scatter(x, y, s=1, color="k")
                # ax.plot(x, y, color='red', ls='-', marker='.')#, label=self.legend(data_ref[0]['strategy']))
                y_serie += [y]
                x_serie += [x]

            m, ci = mean_confidence_interval(y_serie)
            # scenarios_series += [scenario['#VM']]
            m_series += [m]
            upper_ci_series += [m + ci]
            lower_ci_series += [m - ci]
            vms_series += [x_serie[0]]
            # ax.plot(x_serie[0], m, color='red', ls='-', marker='.', label=self.legend(algorithm))

            do_error_bar(x, m, ci, 1, 4)
            # print(x_serie)
            # print(y_serie)
            # print(m)
            # print(ci)

        print vms_series
        print m_series
        ax.plot(vms_series, m_series, color="blue", ls="-", marker=".", label=self.legend(algorithm))
        ax.plot(vms_series, upper_ci_series, color="red", ls="-.", marker=".", label=self.legend(algorithm))
        ax.plot(vms_series, lower_ci_series, color="green", ls="-.", marker=".", label=self.legend(algorithm))
        #        ax.plot(x2, y2b, color='blue', ls='-', marker='o', label=self.legend(data1[0]['strategy']))

        # plt.show()
        plt.savefig(self.result_dir + "/figure-" + trace_file + "-" + title + "-" + algorithm + ".png")
        #        plt.savefig('test.png')
        plt.close()
开发者ID:vonpupp,项目名称:2013-sbrc-experiments,代码行数:60,代码来源:plotdata.py


示例8: test_probabilities

def test_probabilities(exp, n=1000):
    d = {}
    for i in range(n):
        foo = rp.parsex(exp)
        # foo = len(foo.replace(' ',''))
        if foo in d.keys():
            d[foo] += 1
        else:
            d[foo] = 1
    # lists = sorted(d.items())
    # x, y = zip(*lists)  # unpack a list of pairs into two tuples
    # print x
    # print y
    # for a, b in zip(x, y):
    #     plt.text(a,b, str("%s\n%s" % (a, b)))
    plt.xlabel("String length")
    plt.ylabel("Occurence")
    plt.title("Union: %s P=0.3 N=1000" % exp)
    # plt.plot(x, y)

    # For bar chart (use on Union)
    # See for labeling: https://stackoverflow.com/a/30229062
    l = sorted(d.items())
    x, y = zip(*l)
    plt.bar(range(len(y)), y, align="center")
    plt.xticks(range(len(x)), x)

    plt.show()
开发者ID:msunardi,项目名称:rebel_ros,代码行数:28,代码来源:test_redis.py


示例9: plotDist

def plotDist(subplot, X, Y, label):
    pylab.grid()
    pylab.subplot(subplot)
    pylab.bar(X, Y, 0.05)
    pylab.ylabel(label)
    pylab.xticks(arange(len(X)), X)
    pylab.yticks(arange(0,1,0.1))
开发者ID:malimome,项目名称:old-projects,代码行数:7,代码来源:infoSec.py


示例10: plot_cost

    def plot_cost(self):
        if self.show_cost not in self.train_outputs[0][0]:
            raise ShowNetError("Cost function with name '%s' not defined by given convnet." % self.show_cost)
#        print self.test_outputs
        train_errors = [eval(self.layers[self.show_cost]['outputFilter'])(o[0][self.show_cost], o[1])[self.cost_idx] for o in self.train_outputs]
        test_errors = [eval(self.layers[self.show_cost]['outputFilter'])(o[0][self.show_cost], o[1])[self.cost_idx] for o in self.test_outputs]
        if self.smooth_test_errors:
            test_errors = [sum(test_errors[max(0,i-len(self.test_batch_range)):i])/(i-max(0,i-len(self.test_batch_range))) for i in xrange(1,len(test_errors)+1)]
        numbatches = len(self.train_batch_range)
        test_errors = n.row_stack(test_errors)
        test_errors = n.tile(test_errors, (1, self.testing_freq))
        test_errors = list(test_errors.flatten())
        test_errors += [test_errors[-1]] * max(0,len(train_errors) - len(test_errors))
        test_errors = test_errors[:len(train_errors)]

        numepochs = len(train_errors) / float(numbatches)
        pl.figure(1)
        x = range(0, len(train_errors))
        pl.plot(x, train_errors, 'k-', label='Training set')
        pl.plot(x, test_errors, 'r-', label='Test set')
        pl.legend()
        ticklocs = range(numbatches, len(train_errors) - len(train_errors) % numbatches + 1, numbatches)
        epoch_label_gran = int(ceil(numepochs / 20.)) 
        epoch_label_gran = int(ceil(float(epoch_label_gran) / 10) * 10) if numepochs >= 10 else epoch_label_gran 
        ticklabels = map(lambda x: str((x[1] / numbatches)) if x[0] % epoch_label_gran == epoch_label_gran-1 else '', enumerate(ticklocs))

        pl.xticks(ticklocs, ticklabels)
        pl.xlabel('Epoch')
        pl.ylabel(self.show_cost)
        pl.title('%s[%d]' % (self.show_cost, self.cost_idx))
        print "plotted cost"
开发者ID:caomw,项目名称:cuda-convnet2-1,代码行数:31,代码来源:shownet.py


示例11: plot

    def plot(self):
        self._logger.debug('plotting')
        colors = self._colors[:(len(self._categoryData))]
        ind = pylab.arange(len(self._xData))
        bar_width = 1.0 / (len(self._categoryData) + 1)
        bar_groups = []

        for c in range(len(self._categoryData)):
            bars = pylab.bar(ind+c*bar_width, self._yData[c], bar_width, color=colors[c % len(colors)])
            bar_groups.append(bars)

        pylab.xticks(ind+bar_width, self._xData)
        if (self._usingLegend):
            pylab.legend((b[0] for b in bar_groups), self._categoryData,
                         title = self._legendTitle, loc = self._legendLocation,
                         labelspacing = self._legendLabelSpacing, 
                         prop = self._legendFontProps, bbox_to_anchor = self._legendBboxToAnchor)

        pylab.xlabel(self._xLabel, fontdict=self._font)
        pylab.ylabel(self._yLabel, fontdict=self._font)
        pylab.title(self._title, fontdict=self._font)
        if(self._saveFig):
            self._logger.debug('Saving plot as {}'.format(self._saveName))
            pylab.savefig(self._saveName)

        pylab.show()
开发者ID:petevieira,项目名称:ns3-sims,代码行数:26,代码来源:pvplot.py


示例12: Iris_network

def Iris_network(ant, data):
    #G = nx.watts_strogatz_graph(100,3,0.6)
    #G = nx.cubical_graph()
    G = nx.Graph() #無向グラフ

    tmp1 = []
    tmp2 = []
    tmp3 = []
    for i in range(len(data)):
        if data[i][4] == 'setosa':
            tmp1.append(str(i))
        elif data[i][4] == 'versicolor':
            tmp2.append(str(i))
        elif data[i][4] == 'virginica':
            tmp3.append(str(i))

    for i in range(len(data)):
        if len(ant[i].parent) == 0 : pass
        else:
            dest = ant[i].parent[0]
            #G.add_edge(str(ant[i].data), str(ant[dest].data))
            G.add_edge(str(ant[i].Id), str(ant[dest].Id))

    pos = nx.spring_layout(G)

    nx.draw_networkx_nodes(G, pos, nodelist=tmp1, node_size=30, node_color="r")
    nx.draw_networkx_nodes(G, pos, nodelist=tmp2, node_size=30, node_color="w")
    nx.draw_networkx_nodes(G, pos, nodelist=tmp3, node_size=30, node_color="w")
    nx.draw_networkx_edges(G, pos, width=1)
    #nx.draw_networkx_labels(G, pos, font_size=10, font_color="b")
    plt.xticks([])
    plt.yticks([])
    plt.show()
开发者ID:ae14gotou,项目名称:tokuken2,代码行数:33,代码来源:network_Ant.py


示例13: plot_cost

    def plot_cost(self):
        if self.show_cost not in self.train_outputs[0][0]:
            raise ShowNetError("Cost function with name '%s' not defined by given convnet." % self.show_cost)
        train_errors = [o[0][self.show_cost][self.cost_idx] for o in self.train_outputs]
        test_errors = [o[0][self.show_cost][self.cost_idx] for o in self.test_outputs]

        numbatches = len(self.train_batch_range)
        test_errors = numpy.row_stack(test_errors)
        test_errors = numpy.tile(test_errors, (1, self.testing_freq))
        test_errors = list(test_errors.flatten())
        test_errors += [test_errors[-1]] * max(0,len(train_errors) - len(test_errors))
        test_errors = test_errors[:len(train_errors)]

        numepochs = len(train_errors) / float(numbatches)
        pl.figure(1)
        x = range(0, len(train_errors))
        pl.plot(x, train_errors, 'k-', label='Training set')
        pl.plot(x, test_errors, 'r-', label='Test set')
        pl.legend()
        ticklocs = range(numbatches, len(train_errors) - len(train_errors) % numbatches + 1, numbatches)
        epoch_label_gran = int(ceil(numepochs / 20.)) # aim for about 20 labels
        epoch_label_gran = int(ceil(float(epoch_label_gran) / 10) * 10) # but round to nearest 10
        ticklabels = map(lambda x: str((x[1] / numbatches)) if x[0] % epoch_label_gran == epoch_label_gran-1 else '', enumerate(ticklocs))

        pl.xticks(ticklocs, ticklabels)
        pl.xlabel('Epoch')
#        pl.ylabel(self.show_cost)
        pl.title(self.show_cost)
        pl.savefig('cost.png')
开发者ID:HoldenCaulfieldRye,项目名称:pipe-classification,代码行数:29,代码来源:shownet.py


示例14: bar_chart

def bar_chart(categories, xdata, ydata,
              title, xlabel, ylabel,
              font={'family':'serif','color':'black','weight':'normal','size':12,},
              plot=True, saveImage=False, imageName='fig.png'):

    colors = 'rgbcmyk'
    colors = colors[:(len(categories))]

    ind  = pylab.arange(len(xdata))
    bar_width = 1.0 / (len(categories) + 1)
    bar_groups = []

    # loop through categories and plot one bar in each category every loop (ie., one color at a time.)
    fig = pylab.figure()
    for c in range(len(categories)):
        bars = pylab.bar(ind+c*bar_width, ydata[c], bar_width, color=colors[c % len(colors)])
        bar_groups.append(bars)

    fontP = FontProperties()
    fontP.set_size('small')
    pylab.xticks(ind+bar_width, xdata)
    pylab.legend([b[0] for b in bar_groups], categories, 
                 loc='center right', title='Flow #', labelspacing=0,
                 prop=fontP, bbox_to_anchor=(1.125, .7))
    pylab.xlabel(xlabel, fontdict=font)
    pylab.ylabel(ylabel, fontdict=font)
    pylab.title(title, fontdict=font)

    # save the figure
    if saveImage:
        pylab.savefig(imageName)

    # plot the figure
    if plot:
        pylab.show()
开发者ID:petevieira,项目名称:ns3-sims,代码行数:35,代码来源:p1-plot.py


示例15: eqDistribution

    def eqDistribution(self, plot=True):
        """ Obtain and plot the equilibrium probabilities of each macrostate

        Parameters
        ----------
        plot : bool, optional, default=True
            Disable plotting of the probabilities by setting it to False

        Returns
        -------
        eq : ndarray
            An array of equilibrium probabilities of the macrostates

        Examples
        --------
        >>> model = Model(data)
        >>> model.markovModel(100, 5)
        >>> model.eqDistribution()
        """
        self._integrityCheck(postmsm=True)
        macroeq = np.ones(self.macronum) * -1
        for i in range(self.macronum):
            macroeq[i] = np.sum(self.msm.stationary_distribution[self.macro_ofmicro == i])

        if plot:
            from matplotlib import pylab as plt
            plt.ion()
            plt.figure()
            plt.bar(range(self.macronum), macroeq)
            plt.ylabel('Equilibrium probability')
            plt.xlabel('Macrostates')
            plt.xticks(np.arange(0.4, self.macronum+0.4, 1), range(self.macronum))
            plt.show()
        return macroeq
开发者ID:PabloHN,项目名称:htmd,代码行数:34,代码来源:model.py


示例16: plot_tuning_curves

def plot_tuning_curves(direction_rates, title):
    """
    This function takes the x-values and the y-values  in units of spikes/s 
    (found in the two columns of direction_rates) and plots a histogram and 
    polar representation of the tuning curve. It adds the given title.
    """
    x = direction_rates[:,0]
    y = direction_rates[:,1]
    plt.figure()
    plt.subplot(2,2,1)
    plt.bar(x,y,width=45,align='center')
    plt.xlim(-22.5,337.5)
    plt.xticks(x)
    plt.xlabel('Direction of Motion (degrees)')
    plt.ylabel('Firing Rate (spikes/s)')
    plt.title(title)   
        
        
    
    plt.subplot(2,2,2,polar=True)
    r = np.append(y,y[0])
    theta = np.deg2rad(np.append(x, x[0]))
    plt.polar(theta,r,label='Firing Rate (spikes/s)')
    plt.legend(loc=8)
    plt.title(title)
开发者ID:emirvine,项目名称:psyc-179,代码行数:25,代码来源:problem_set2_solutions.py


示例17: plotRocCurves

def plotRocCurves(lesion, lesion_en):
	file_legend = []
	for techniqueMid in techniquesMid:
		for techniqueLow in techniquesLow:
			file_legend.append((directory + techniqueLow + "/" + techniqueMid + "/operating-points-" + lesion + "-scale.dat", "Low-level: " + techniqueLow + ". Mid-level: " + techniqueMid + "."))
			
			pylab.clf()
			pylab.figure(1)
			pylab.xlabel('1 - Specificity', fontsize=12)
			pylab.ylabel('Sensitivity', fontsize=12)
			pylab.title(lesion_en)
			pylab.grid(True, which='both')
			pylab.xticks([i/10.0 for i in range(1,11)])
			pylab.yticks([i/10.0 for i in range(0,11)])
			#pylab.tick_params(axis="both", labelsize=15)
			
			for file, legend in file_legend:
				points = open(file,"rb").readlines()
				x = [float(p.split()[0]) for p in points]
				y = [float(p.split()[1]) for p in points]
				x.append(0.0)
				y.append(0.0)
				
				auc = numpy.trapz(y, x) * -100

				pylab.grid()
				pylab.plot(x, y, '-', linewidth = 1.5, label = legend + u" (AUC = {0:0.1f}%)".format(auc))

	pylab.legend(loc = 4, borderaxespad=0.4, prop={'size':12})
	pylab.savefig(directory + "plots/" + lesion + ".pdf", format='pdf')
开发者ID:piresramon,项目名称:pires.ramon.msc,代码行数:30,代码来源:classification.py


示例18: boxplot_poi

def boxplot_poi(data, var_name):
    """
    Makes box plot with variable "var_name"
    split into
    :param data: data dict with enron data
    :param var_name: name of variable to plot
    :return: plot object
    """
    poi_v = []
    no_poi_v = []
    for p in data.itervalues():
        value = p[var_name]
        if value == "NaN":
            value = 0
        if p["poi"] == 1:
            poi_v.append(value)
        else:
            no_poi_v.append(value)
    plt.xlabel("POI")
    plt.ylabel(var_name)
    plt.boxplot([poi_v, no_poi_v])
    plt.xticks([1, 2], ["POI", "Not a POI"])
    # http://stackoverflow.com/a/29780292/1952996
    for i, v in enumerate([poi_v, no_poi_v]):
        y = v
        x = np.random.normal(i+1, 0.04, size = len(y))
        plt.plot(x, y, "r.", alpha=0.2)
开发者ID:zelite,项目名称:Identify-fraud-from-enron-email,代码行数:27,代码来源:plotting.py


示例19: plotRocCurves

def plotRocCurves(file_legend):
	pylab.clf()
	pylab.figure(1)
	pylab.xlabel('1 - Specificity', fontsize=12)
	pylab.ylabel('Sensitivity', fontsize=12)
	pylab.title("Need for Referral")
	pylab.grid(True, which='both')
	pylab.xticks([i/10.0 for i in range(1,11)])
	pylab.yticks([i/10.0 for i in range(0,11)])
	pylab.tick_params(axis="both", labelsize=15)

	for file, legend in file_legend:
		points = open(file,"rb").readlines()
		x = [float(p.split()[0]) for p in points]
		y = [float(p.split()[1]) for p in points]
		dev = [float(p.split()[2]) for p in points]
		x = [0.0] + x
		y = [0.0] + y
		dev = [0.0] + dev
	
		auc = np.trapz(y, x) * 100
		aucDev = np.trapz(dev, x) * 100

		pylab.grid()
		pylab.errorbar(x, y, yerr = dev, fmt='-')
		pylab.plot(x, y, '-', linewidth = 1.5, label = legend + u" (AUC = {0:0.1f}% \xb1 {1:0.1f}%)".format(auc,aucDev))

	pylab.legend(loc = 4, borderaxespad=0.4, prop={'size':12})
	pylab.savefig("referral/referral-curves.pdf", format='pdf')
开发者ID:piresramon,项目名称:retina.bovw.plosone,代码行数:29,代码来源:referral.py


示例20: plot_p

def plot_p(frame):
    sol=Solution(frame,file_format='petsc',read_aux=False,path='./_output/_p/',file_prefix='claw_p')
    x=sol.state.grid.x.centers; y=sol.state.grid.y.centers
    mx=len(x); my=len(y)
    
    mp=sol.state.num_eqn    
    yy,xx = np.meshgrid(y,x)

    p=sol.state.q[0,:,:]
    fig = pl.figure(figsize=(8, 3.5))
    #pl.title("t= "+str(sol.state.t),fontsize=20)
    pl.xticks(size=20); pl.yticks(size=20)
    pl.xlabel('x',fontsize=20); pl.ylabel('y',fontsize=20)
    #pl.pcolormesh(xx,yy,p_subxy,cmap=cm.OrRd)
    pl.pcolormesh(xx,yy,p,cmap='RdBu_r')
    pl.autoscale(tight=True)
    cb = pl.colorbar(ticks=[0.5,1,1.5,2]);
    
    #pl.clim(ticks=[0.5,1,1.5,2])
    imaxes = pl.gca(); pl.axes(cb.ax)
    pl.yticks(fontsize=20); pl.axes(imaxes)
    #pl.xticks(fontsize=20); pl.axes(imaxes)
    #pl.axis('equal')
    pl.axis('tight')
    fig.tight_layout()
    pl.savefig('./_plots_to_paper/sound-speed_FV_t'+str(frame)+'_pcolor.png')
    pl.close()
开发者ID:ketch,项目名称:effective_dispersion_RR,代码行数:27,代码来源:plots_to_paper.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python pylab.ylabel函数代码示例发布时间:2022-05-27
下一篇:
Python pylab.xscale函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap