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

Python pylab.setp函数代码示例

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

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



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

示例1: plot_count

def plot_count(fname, dpi=70):
    # Load data
    date, libxc, c, code, test, doc = np.loadtxt(fname, unpack=True)
    zero = pl.zeros_like(date)

    fig = pl.figure(1, figsize=(10, 5), dpi=dpi)
    ax = fig.add_subplot(111)
    polygon(date, c + libxc + code + test, c + libxc + code + test + doc, facecolor="m", label="Documentation")
    polygon(date, c + libxc + code, c + libxc + code + test, facecolor="y", label="Tests")
    polygon(date, c + libxc, c + libxc + code, facecolor="g", label="Python-code")
    polygon(date, c, c + libxc, facecolor="c", label="LibXC-code")
    polygon(date, zero, c, facecolor="r", label="C-code")
    polygon(date, zero, zero, facecolor="b", label="Fortran-code")

    months = pl.MonthLocator()
    months4 = pl.MonthLocator(interval=4)
    month_year_fmt = pl.DateFormatter("%b '%y")

    ax.xaxis.set_major_locator(months4)
    ax.xaxis.set_minor_locator(months)
    ax.xaxis.set_major_formatter(month_year_fmt)
    labels = ax.get_xticklabels()
    pl.setp(labels, rotation=30)
    pl.axis("tight")
    pl.legend(loc="upper left")
    pl.title("Number of lines")
    pl.savefig(fname.split(".")[0] + ".png", dpi=dpi)
开发者ID:eojons,项目名称:gpaw-scme,代码行数:27,代码来源:code-count.py


示例2: _add_graph

    def _add_graph(self, data):
        x = False
        if self._decimate:
            x, data = self._decimate_data(data, self._bins)

        ax = self._fig.add_axes([self._margin * 2, # left
                                    1 - self._margin - self._client_space / self._total_height * (self._counter + 1), # bottom
                                    self._client_space - self._margin, # width
                                    self._client_space / self._total_height * 0.9 # height
                                ], **self._axprops)

        if x:
            ax.plot(x, data)
        else:
            ax.plot(data)

        self._counter += 1

        if self._counter == 1:
            self._axprops['sharex'] = ax

        if self._counter < self._total_height:
            pylab.setp(ax.get_xticklabels(), visible=False)

        return ax
开发者ID:antiface,项目名称:dsp-testbed,代码行数:25,代码来源:pylab_tools.py


示例3: cmap_plot

def cmap_plot(cmdLine):

    pylab.figure(figsize=[5,10])
    a=outer(ones(10),arange(0,1,0.01))
    subplots_adjust(top=0.99,bottom=0.00,left=0.01,right=0.8)
    maps=[m for m in cm.datad if not m.endswith("_r")]
    maps.sort()
    l=len(maps)+1
    for i, m in enumerate(maps):
        print m
        subplot(l,1,i+1)
        pylab.setp(pylab.gca(),xticklabels=[],xticks=[],yticklabels=[],yticks=[])
        imshow(a,aspect='auto',cmap=get_cmap(m),origin="lower")
        pylab.text(100.85,0.5,m,fontsize=10)

# render plot

    if cmdLine: 
        pylab.show(block=True)
    else: 
        pylab.ion()
        pylab.plot([])
        pylab.ioff()
	
    status = 1
    return status
开发者ID:KeplerGO,项目名称:PyKE,代码行数:26,代码来源:kepprf.py


示例4: plot_commerror

def plot_commerror(name1,logfile1,name2,logfile2):

  file1 = open(str(logfile1),'r').readlines()
  data1 = [float(line.split()[1]) for line in file1]
  iso1 = data1[0::3]
  aniso1 = data1[1::3]
  ml1 = data1[2::3]

  file2 = open(str(logfile2),'r').readlines()
  data2 = [float(line.split()[1]) for line in file2]
  iso2 = data2[0::3]
  aniso2 = data2[1::3]
  ml2 = data2[2::3]

  # x axis
  x=[8,16,32,64,128]
  xlabels=['A','B','C','D','E']
  orderone = [1,.5,.25,.125,.0625]
  ordertwo = [i**2 for i in orderone]
  plot1 = pylab.figure(figsize = (6, 6.5))
  size = 15
  ax = pylab.subplot(111)
  ax.plot(x,iso1, linestyle='solid',color='red',lw=2)
  ax.plot(x,aniso1, linestyle='dashed',color='red',lw=2)
  ax.plot(x,ml1, linestyle='dashdot',color='red',lw=2)
  ax.plot(x,iso2, linestyle='solid',color='blue',lw=2)
  ax.plot(x,aniso2, linestyle='dashed',color='blue',lw=2)
  ax.plot(x,ml2, linestyle='dashdot',color='blue',lw=2)
  #ax.plot(x,orderone, linestyle='solid',color='black',lw=2)
  #ax.plot(x,ordertwo, linestyle='dashed',color='black')
  #pylab.legend((str(name1)+'_iso',str(name1)+'_aniso',str(name2)+'_iso',str(name2)+'_aniso','order 1'),loc="best")
  pylab.legend((str(name1)+'_iso',str(name1)+'_aniso',str(name1)+'_ml',str(name2)+'_iso',str(name2)+'_aniso',str(name2)+'_ml'),loc="best")
  leg = pylab.gca().get_legend()
  ltext = leg.get_texts()
  pylab.setp(ltext, fontsize = size, color = 'black')
  frame=leg.get_frame()
  frame.set_fill(False)
  frame.set_visible(False)

  #ax.grid("True")
  for tick in ax.xaxis.get_major_ticks():
    tick.label1.set_fontsize(size)
  for tick in ax.yaxis.get_major_ticks():
    tick.label1.set_fontsize(size)

  # set axes to logarithmic
  pylab.gca().set_xscale('log',basex=2)
  pylab.gca().set_yscale('log',basex=2)

  pylab.axis([8,128,1.e-4,2])
  ax.set_xticks(x)
  ax.set_xticklabels(xlabels)

  #pylab.axis([1,5,1.e-6,1.])
  ax.set_xlabel('Mesh resolution', ha="center",fontsize=size)
  ax.set_ylabel('commutation error',fontsize=size)
  pylab.savefig('commerrorplot.eps')
  pylab.savefig('commerrorplot.pdf')

  return
开发者ID:Nasrollah,项目名称:fluidity,代码行数:60,代码来源:plot_data.py


示例5: _draw_main_error

    def _draw_main_error(self):
        """
        plot the error with respect to the true solution on our optional
        visualization
        """
        myg = self.grids[self.nlevels - 1].grid

        v = self.grids[self.nlevels - 1].get_var("v")

        e = v - self.true_function(myg.x2d, myg.y2d)

        pylab.imshow(
            numpy.transpose(e[myg.ilo : myg.ihi + 1, myg.jlo : myg.jhi + 1]),
            interpolation="nearest",
            origin="lower",
            extent=[self.xmin, self.xmax, self.ymin, self.ymax],
        )

        pylab.xlabel("x")
        pylab.ylabel("y")

        pylab.title(r"current fine grid error")

        formatter = matplotlib.ticker.ScalarFormatter(useMathText=True)
        cb = pylab.colorbar(format=formatter, shrink=0.5)

        cb.ax.yaxis.offsetText.set_fontsize("small")
        cl = pylab.getp(cb.ax, "ymajorticklabels")
        pylab.setp(cl, fontsize="small")
开发者ID:jzuhone,项目名称:pyro2,代码行数:29,代码来源:multigrid.py


示例6: draw_plot

    def draw_plot(self):
        if len(self.data_t) < 2:
            return
        if  self.data_t[-1] < self.data_t[-2]:
            del self.data_t[:-1]
            del self.data_y[:-1]
            del self.data_y2[:-1]
            self.axes.set_xlim(self.data_t[-1],self.data_t[-1]+20)
            return

        T1 = self.data_t[-1]
        xmin, xmax = self.axes.get_xlim()
        if T1 > xmax:
            self.axes.set_xlim(xmax,xmax+20)
            del self.data_t[:-2]
            del self.data_y[:-2]
            del self.data_y2[:-2]
            pylab.setp(self.axes.get_xticklabels(), visible=True)

        self.plot_data[0].set_data(self.data_t, self.data_y)
        self.plot_data[1].set_data(self.data_t, self.data_y2)

        if not self.drawing:
            self.drawing = True
            self.draw()
            self.drawing = False
开发者ID:klvt,项目名称:fiwt,代码行数:26,代码来源:dynamic_chart.py


示例7: init_plot

    def init_plot(self):
        self.dpi = 150
        self.fig = Figure((3.0, 3.0), dpi=self.dpi)

        self.axes = self.fig.add_subplot(111)
        self.axes.set_axis_bgcolor('black')
        self.axes.set_title('Accelerometer Values', size=12)
        
        pylab.setp(self.axes.get_xticklabels(), fontsize=8)
        pylab.setp(self.axes.get_yticklabels(), fontsize=8)

        # plot the data as a line series, and save the reference 
        # to the plotted line series
        #
        self.plot_data1 = self.axes.plot(
            self.data1, 
            linewidth=1,
            color=(1, 1, 0),
            )[0]
        self.plot_data2 = self.axes.plot(
            self.data2, 
            linewidth=1,
            color=(1, 0, 1),
            )[0]
        self.plot_data3 = self.axes.plot(
            self.data3, 
            linewidth=1,
            color=(0, 1, 1),
            )[0]
开发者ID:agupta13,项目名称:mPaaS,代码行数:29,代码来源:demo.py


示例8: plot_data

def plot_data(data_, O, P, save=False):
    assert len(data_) == 2  # Coarse, fine.
    colors = ["r", "b"]
    i = 0
    p.figure()
    p.xlabel("$\mu \, (\mathrm{GeV})$", fontsize=16)
    label = str(O + 1) + str(P + 1)
    p.ylabel("$\sigma_{0}$".format("{" + label + "}"), fontsize=16)
    legend = ()

    # Interpolate raw data.
    for data in data_:
        x_, y_, s_, x, y, s = interpolation(data, O, P)
        dada = p.plot(x, y, "o", x_, y_(x_), "-")  # ,
        # x_, y_(x_)+s_(x_), '--', x_, y_(x_)-s_(x_), '--')
        legend += (dada[1],)
        p.setp(dada, color=colors[i])
        i += 1

    # Continuum extrapolate interpolated data.
    x_, y, s = continuum_extrap(data_[0], data_[1], O, P)
    dada = p.plot(x_, y, "-")  # , x_, y+s, '--', x_, y-s, '--')
    legend += (dada[0],)
    p.setp(dada, color="green")

    p.legend(legend, ("$a=0.116 \, \mathrm{fm}$", "$a=0.088 \, \mathrm{fm}$", "$a=0$"), "best")

    # Output.
    if save:
        root = "/Users/atlytle/Dropbox/TeX_docs/soton/SUSY_BK/exceptional/figs"
        p.savefig(root + "/sigma_exceptional_{0}.pdf".format(label))
    else:
        p.show()
开发者ID:atlytle,项目名称:soton_qcd,代码行数:33,代码来源:IW_E_stepscale.py


示例9: init_plot

    def init_plot(self):
        self.dpi = 100
        self.fig = Figure((3.0, 3.0), dpi=self.dpi)
        self.axes = []
        
        for n in range(self.numplots):
            self.axes.append(self.fig.add_subplot(1,self.numplots,n))
            self.axes[n].set_title('SAS Temperature Data', size=12)
            pylab.setp(self.axes[n].get_xticklabels(), fontsize=8)
            pylab.setp(self.axes[n].get_yticklabels(), fontsize=8)

        # plot the data as a line series, and save the reference 
        # to the plotted line series
        #
        self.plot_data = []
        labels = self.datagen.labels
        for n in range(len(self.data)):
            self.plot_data.append([])
            for i in range(len(self.data[n])):
                self.plot_data[n].append(self.axes[n].plot(np.arange(10),
                                                     linewidth=1,
                                                     label=labels[n][i],
                                                     #color=(1, 1, 0),  #let it auto-select colors
                                                     )[0])
            self.axes[n].legend(loc='best',fontsize=6,ncol=6)
        self.plot_index = 0
开发者ID:HEROES-Balloon,项目名称:SAS_Telemetry_Viewer,代码行数:26,代码来源:SAS_Telemetry_Viewer.py


示例10: plot_dco_values

def plot_dco_values(ax, values, color="k"):
    interpol1 = {"temperature": values["temperature"][0:7], "values": values["values"][0:7]}
    fit1 = pylab.polyfit(interpol1["temperature"], interpol1["values"], 1)
    print "m={} b={}".format(fit1[0], fit1[1])
    fit_fn1 = pylab.poly1d(fit1)

    interpol2 = {"temperature": values["temperature"][6:14], "values": values["values"][6:14]}
    fit2 = pylab.polyfit(interpol2["temperature"], interpol2["values"], 1)
    print "m={} b={}".format(fit2[0], fit2[1])
    fit_fn2 = pylab.poly1d(fit2)

    plot = ax.plot(
        interpol1["temperature"],
        fit_fn1(interpol1["temperature"]),
        "k-",
        interpol2["temperature"],
        fit_fn2(interpol2["temperature"]),
        "k-",
        # values['temperature'], values['values'], '{}-'.format(color),
        values["temperature"],
        values["values"],
        "{}o".format(color),
        markersize=5,
    )
    pylab.setp(plot[0], linewidth=2)
    pylab.setp(plot[1], linewidth=2)

    return plot
开发者ID:salkinium,项目名称:bachelor,代码行数:28,代码来源:baudrate_parser.py


示例11: barGraph

def barGraph(data, **kw):
    """Draws a bar graph for the given data"""
    from pylab import bar
    kw.setdefault('barw', 0.5)
    kw.setdefault('log', 0)
    kw.setdefault('color', 'blue')
    xs = [i+1 for i, row in enumerate(data)]
    names, ys = zip(*data)
    names = [n.replace('_', '\n') for n in names]
    #print 'got xs %s, ys %s, names %s' % (xs, ys, names)
    bar(xs, ys, width=kw['barw'], color=kw['color'], align='center', log=kw['log'])
    ax = pylab.gca()
    def f(x, pos=None):
        n = int(x) - 1
        if n+1 != x: return ''
        if n < 0: return ''
        try:
            return names[n]
        except IndexError: return ''

    ax.xaxis.set_major_formatter(pylab.FuncFormatter(f))
    ax.xaxis.set_major_locator(pylab.MultipleLocator(1))
    ax.set_xlim(0.5, len(names)+0.5)
    for l in ax.get_xticklabels():
        pylab.setp(l, rotation=90)
    start = 0.08, 0.18
    pos = (start[0], start[1], 0.99-start[0], 0.95-start[1])
    ax.set_position(pos)
开发者ID:neeraj-kumar,项目名称:nkpylib,代码行数:28,代码来源:nkplot.py


示例12: ConfigCAngles

def ConfigCAngles():
    pylab.figure(figsize=(3.5, 3.5))
    pylab.axes((0.0, 0.0, 1.0, 1.0))
    geo = ps.LoadGeo()

    phi_i0 = geo.phi_i0
    phi_is = geo.phi_is
    phi_ie = geo.phi_ie

    phi_o0 = geo.phi_o0
    phi_os = geo.phi_os
    phi_oe = geo.phi_oe

    phi1 = np.linspace(phi_is, phi_ie, 1000)
    phi2 = np.linspace(phi_i0, phi_is, 1000)
    phi3 = np.linspace(phi_os, phi_oe, 1000)
    phi4 = np.linspace(phi_o0, phi_os, 1000)
    (xi1, yi1) = ps.coords_inv(phi1, geo, 0, "fi")
    (xi2, yi2) = ps.coords_inv(phi2, geo, 0, "fi")
    (xo1, yo1) = ps.coords_inv(phi3, geo, 0, "fo")
    (xo2, yo2) = ps.coords_inv(phi4, geo, 0, "fo")

    #### Inner and outer involutes
    pylab.plot(xi1, yi1, "k", lw=1)
    pylab.plot(xi2, yi2, "k:", lw=1)
    pylab.plot(xo1, yo1, "k", lw=1)
    pylab.plot(xo2, yo2, "k:", lw=1)

    ### Innver involute labels
    pylab.plot(xi2[0], yi2[0], "k.", markersize=5, mew=2)
    pylab.text(xi2[0], yi2[0] + 0.0025, "$\phi_{i0}$", size=8, ha="right", va="bottom")
    pylab.plot(xi1[0], yi1[0], "k.", markersize=5, mew=2)
    pylab.text(xi1[0] + 0.002, yi1[0], "$\phi_{is}$", size=8)
    pylab.plot(xi1[-1], yi1[-1], "k.", markersize=5, mew=2)
    pylab.text(xi1[-1] - 0.002, yi1[-1], "   $\phi_{ie}$", size=8, ha="right", va="center")

    ### Outer involute labels
    pylab.plot(xo2[0], yo2[0], "k.", markersize=5, mew=2)
    pylab.text(xo2[0] + 0.002, yo2[0], "$\phi_{o0}$", size=8, ha="left", va="top")
    pylab.plot(xo1[0], yo1[0], "k.", markersize=5, mew=2)
    pylab.text(xo1[0] + 0.002, yo1[0], "$\phi_{os}$", size=8)
    pylab.plot(xo1[-1], yo1[-1], "k.", markersize=5, mew=2)
    pylab.text(xo1[-1] - 0.002, yo1[-1], "   $\phi_{oe}$", size=8, ha="right", va="center")

    ### Base circle
    t = np.linspace(0, 2 * pi, 100)
    pylab.plot(geo.rb * np.cos(t), geo.rb * np.sin(t), "b-")
    pylab.plot(np.r_[0, geo.rb * np.cos(9 * pi / 8)], np.r_[0, geo.rb * np.sin(9 * pi / 8)], "k-")
    pylab.text(
        geo.rb * np.cos(9 * pi / 8) + 0.0005, geo.rb * np.sin(9 * pi / 8) + 0.001, "$r_b$", size=8, ha="right", va="top"
    )

    pylab.axis("equal")
    pylab.setp(pylab.gca(), "ylim", (min(yo1) - 0.005, max(yo1) + 0.005))
    pylab.axis("off")

    pylab.savefig("FixedScrollAngles.png", dpi=600)
    pylab.savefig("FixedScrollAngles.eps")
    pylab.savefig("FixedScrollAngles.pdf")
    pylab.close()
开发者ID:bo3mrh,项目名称:Test,代码行数:60,代码来源:paperIII.py


示例13: plot_clusters

def plot_clusters(locations, idx, centroids):
    locations = np.array(locations)
    print "the cluster labels ", idx
    plot(
        locations[idx == 0, 0],
        locations[idx == 0, 1],
        "ob",
        locations[idx == 1, 0],
        locations[idx == 1, 1],
        "or",
        locations[idx == 2, 0],
        locations[idx == 2, 1],
        "ok",
        locations[idx == 3, 0],
        locations[idx == 3, 1],
        "oc",
        locations[idx == 4, 0],
        locations[idx == 4, 1],
        "oy",
        locations[idx == 5, 0],
        locations[idx == 5, 1],
        "om",
        locations[idx == 6, 0],
        locations[idx == 6, 1],
        "og",
    )
    plot(centroids[:, 0], centroids[:, 1], "sg", markersize=8)
    setp(gca(), "ylim", reversed(getp(gca(), "ylim")))
    show()
开发者ID:qingquan,项目名称:experiment,代码行数:29,代码来源:pruning.py


示例14: init_plot

    def init_plot(self):
        self.fig = Figure((4.0, 2.0), dpi=100)

        self.axes = self.fig.add_subplot(111)
        self.axes.set_axis_bgcolor('black')
        #self.axes.set_title('Rotation', size=12)
        
        pylab.setp(self.axes.get_xticklabels(), fontsize=8)
        pylab.setp(self.axes.get_yticklabels(), fontsize=8)

        # plot the data as a line series, and save the reference 
        # to the plotted line series
        #
        self.plotLinex = self.axes.plot(
            self.pldatLineX, 
            linewidth=1,
            color=(1, 0, 0),
            )[0]
        self.plotLiney = self.axes.plot(
            self.pldatLineY, 
            linewidth=1,
            color=(0, 1, 0),
            )[0]
        self.plotLinez = self.axes.plot(
            self.pldatLineZ, 
            linewidth=1,
            color=(0, 0, 1),
            )[0]
        
        self.xmin = 0
        self.xmax = 0
        self.ymin = -10
        self.ymax = 10
开发者ID:mdicke2s,项目名称:yudrone,代码行数:33,代码来源:plot.py


示例15: __init__

    def __init__(self, ticker):
        gtk.VBox.__init__(self)

        startdate = datetime.date(2001, 1, 1)
        today = enddate = datetime.date.today()

        date1 = datetime.date(2011, 1, 1)
        date2 = datetime.date.today()

        mondays = WeekdayLocator(MONDAY)  # major ticks on the mondays
        alldays = DayLocator()  # minor ticks on the days
        weekFormatter = DateFormatter("%b %d")  # Eg, Jan 12
        dayFormatter = DateFormatter("%d")  # Eg, 12

        quotes = quotes_historical_yahoo(ticker, date1, date2)
        if len(quotes) == 0:
            raise SystemExit

        fig = Figure(facecolor="white", figsize=(5, 4), dpi=100)
        fig.subplots_adjust(bottom=0.2)
        ax = fig.add_subplot(111)
        ax.xaxis.set_major_locator(mondays)
        ax.xaxis.set_minor_locator(alldays)
        ax.xaxis.set_major_formatter(weekFormatter)
        candlestick(ax, quotes, width=0.6)

        ax.xaxis_date()
        ax.autoscale_view()
        pylab.setp(pylab.gca().get_xticklabels(), rotation=45, horizontalalignment="right")

        canvas = FigureCanvas(fig)  # a gtk.DrawingArea
        self.pack_start(canvas)
        toolbar = NavigationToolbar(canvas, win)
        self.pack_start(toolbar, False, False)
开发者ID:nicolasmarti,项目名称:misc-dev-2,代码行数:34,代码来源:yhstckcancas.py


示例16: buildAtmos

    def buildAtmos(self, secz, xlim=[300, 1100], doPlot=False):
        """Generate the total atmospheric transmission profile at this airmass, using the coefficients C."""
        # Burke paper says atmosphere put together as 
        # Trans_total (alt/az/time) = Tgray * (e^-Z*tau_aerosol(alt/az/t)) * 
        #         * (1 - C_mol * BP(t)/BPo * A_mol(Z))  -- line 2
        #         * (1 - sqrt(C_mol * BP(t)/BPo) * A_mol(Z))  -- 3
        #         * (1 - C_O3 * A_O3(A) )
        #         * (1 - C_H2O(alt/az/time) * A_H2O(Z))
        # Tau_aerosol = trans['aerosol'] ... but replace with power law (because here all 1's)
        #  typical power law index is about tau ~ lambda^-1
        # A_mol = trans['O2']
                
        # secz = secz of this observation
        # wavelen / atmo_templates == building blocks of atmosphere, with seczlist / atmo_ind keys
        # C = coeffsdictionary = to, t1, t2, alpha0 (for aerosol), C_mol, BP, C_O3, C_H2O  values    
        if (abs(secz - self.secz) > interplimit):
            print "Generating interpolated atmospheric absorption profiles for this airmass %f" %(secz)
            self.interpolateSecz(secz)

        BP0 = 782 # mb
        # set aerosol appropriately with these coefficients
        self.atmo_abs['aerosol'] = 1.0 - numpy.exp(-secz * (self.C['t0'] + self.C['t1']*0.0 + self.C['t2']*0.0) 
                                                   * (self.wavelen/675.0)**self.C['alpha'])
        # set total transmission, with appropriate coefficients
        self.trans_total = numpy.ones(len(self.wavelen), dtype='float')
        self.trans_total = self.trans_total * (1.0 - self.C['mol'] * self.C['BP']/BP0 * self.atmo_abs['rayleigh'])  \
                      * ( 1 - numpy.sqrt(self.C['mol'] * self.C['BP']/BP0) * self.atmo_abs['O2']) \
                      * ( 1 - self.C['O3'] * self.atmo_abs['O3']) \
                      * ( 1 - self.C['H2O'] * self.atmo_abs['H2O']) \
                      * ( 1 - self.atmo_abs['aerosol'])
        # now we can plot the atmosphere
        if doPlot:
            pylab.figure()
            pylab.subplot(212)
            colorindex = 0
            for comp in self.atmo_ind:
                pylab.plot(self.wavelen, self.atmo_abs[comp], colors[colorindex], label='%s' %(comp))
                colorindex = self._next_color(colorindex)        
            leg =pylab.legend(loc=(0.88, 0.3), fancybox=True, numpoints=1, shadow=True)
            ltext = leg.get_texts()
            pylab.setp(ltext, fontsize='small')
            coefflabel = ""
            for comp in ('mol', 't0', 'alpha', 'O3', 'H2O'):
                coefflabel = coefflabel + "C[%s]:%.2f  " %(comp, self.C[comp])
                if (comp=='alpha') | (comp=='mol'):
                    coefflabel = coefflabel + "\n"
            pylab.figtext(0.2, 0.35, coefflabel, fontsize='small')
            pylab.xlim(xlim[0], xlim[1])
            pylab.ylim(0, 1.0)
            pylab.xlabel("Wavelength (nm)")
            pylab.subplot(211)
            pylab.plot(self.wavelen, self.atmo_trans[self.seczToString(1.2)]['comb'], 'r-', label='Standard X=1.2 (no aerosols)')
            pylab.plot(self.wavelen, self.trans_total, 'k-', label='Observed')
            leg = pylab.legend(loc=(0.12, 0.05), fancybox=True, numpoints=1, shadow=True)
            ltext = leg.get_texts()
            pylab.setp(ltext, fontsize='small')
            pylab.xlim(xlim[0], xlim[1])
            pylab.ylim(0, 1.0)
            pylab.title("Example Atmosphere at X=%.2f" %(secz))
        return
开发者ID:moeyensj,项目名称:atmo2mags-Notebooks,代码行数:60,代码来源:AtmoCompMod.py


示例17: __init__

    def __init__(self,parent):
        self.data_t = [0]
        self.data_y = [0]
        self.data_y2 = [0]

        self.dpi = 100
        self.fig = Figure((3.0, 3.0), dpi=self.dpi)

        self.axes = self.fig.add_subplot(111)
        pylab.setp(self.axes.get_xticklabels(), fontsize=10)
        pylab.setp(self.axes.get_yticklabels(), fontsize=10)

        # plot the data as a line series, and save the reference 
        # to the plotted line series
        #
        self.plot_data = self.axes.plot(
            self.data_t,self.data_y,'y',
            self.data_t,self.data_y2,'c',
            )

        ymin = -30
        ymax = 30
        self.axes.set_ybound(lower=ymin, upper=ymax)
        self.axes.set_xlim(0, 20)
        self.axes.grid(True)

        FigCanvas.__init__(self, parent, -1, self.fig)
        self.drawing = False
开发者ID:klvt,项目名称:fiwt,代码行数:28,代码来源:dynamic_chart.py


示例18: trace

def trace(data, name, format='png', datarange=(None, None), suffix='', path='./', rows=1, columns=1, num=1, last=True, fontmap = {1:10, 2:8, 3:6, 4:5, 5:4}, verbose=1):
    # Internal plotting specification for handling nested arrays

    # Stand-alone plot or subplot?
    standalone = rows==1 and columns==1 and num==1

    if standalone:
        if verbose>0:
            print 'Plotting', name
        figure()

    subplot(rows, columns, num)
    pyplot(data.tolist())
    ylim(datarange)

    # Plot options
    if last:
        xlabel('Iteration', fontsize='x-small')
    ylabel(name, fontsize='x-small')

    # Smaller tick labels
    tlabels = gca().get_xticklabels()
    setp(tlabels, 'fontsize', fontmap[rows])

    tlabels = gca().get_yticklabels()
    setp(tlabels, 'fontsize', fontmap[rows])

    if standalone:
        if not os.path.exists(path):
            os.mkdir(path)
        if not path.endswith('/'):
            path += '/'
        # Save to file
        savefig("%s%s%s.%s" % (path, name, suffix, format))
开发者ID:along1x,项目名称:pymc,代码行数:34,代码来源:Matplot.py


示例19: draw_plot

    def draw_plot(self):
        """ Redraws the plot
        """
        import numpy, pylab
        state = self.state

        if len(self.data[0]) == 0:
            print("no data to plot")
            return
        vhigh = max(self.data[0])
        vlow  = min(self.data[0])

        for i in range(1,len(self.plot_data)):
            vhigh = max(vhigh, max(self.data[i]))
            vlow  = min(vlow,  min(self.data[i]))
        ymin = vlow  - 0.05*(vhigh-vlow)
        ymax = vhigh + 0.05*(vhigh-vlow)

        if ymin == ymax:
            ymax = ymin + 0.1
            ymin = ymin - 0.1
        self.axes.set_ybound(lower=ymin, upper=ymax)
        self.axes.grid(True, color='gray')
        pylab.setp(self.axes.get_xticklabels(), visible=True)
        pylab.setp(self.axes.get_legend().get_texts(), fontsize='small')

        for i in range(len(self.plot_data)):
            ydata = numpy.array(self.data[i])
            xdata = self.xdata
            if len(ydata) < len(self.xdata):
                xdata = xdata[-len(ydata):]
            self.plot_data[i].set_xdata(xdata)
            self.plot_data[i].set_ydata(ydata)

        self.canvas.draw()
开发者ID:1ee7,项目名称:MAVProxy,代码行数:35,代码来源:live_graph_ui.py


示例20: plot_aggregate_results

def plot_aggregate_results(wf_name, data):

    aggr = lambda results: int(interval_statistics(results if len(results) > 0 else [0.0])[0])
    # aggr = lambda results: len(results)

    data = data[wf_name]

    bins = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
    value_map = {b: [] for b in bins}

    for d in data:
        fcount = d["result"]["overall_failed_tasks_count"]
        makespan = d["result"]["makespan"]
        value_map[fcount].append(makespan)

    values = [bin for bin, values in sorted(value_map.items(), key=lambda x: x[0]) for _ in values]



    plt.grid(True)

    n, bins, patches = pylab.hist(values, bins, histtype='stepfilled')
    pylab.setp(patches, 'facecolor', 'g', 'alpha', 0.75)


    values = [aggr(values) for bin, values in sorted(value_map.items(), key=lambda x: x[0])]
    rows = [[str(v) for v in values]]

    the_table = plt.table(cellText=rows,
                      rowLabels=None,
                      colLabels=bins,
                      loc='bottom')

    pass
开发者ID:fonhorst,项目名称:heft,代码行数:34,代码来源:stat_aggregator.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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