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

Python pylab.cla函数代码示例

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

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



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

示例1: plot_timeseries

    def plot_timeseries(self, ax=None, vmin=None, vmax=None,
            colorbar=False, label=True):

        if vmin is None:
            vmin = self.vmin

        if vmax is None:
            vmax = self.vmax

        if ax is None:
            ax = plt.gca()
        plt.sca(ax)
        plt.cla()
        plt.imshow(self.tser_arr[::-1,:], vmin=vmin, vmax=vmax,
            interpolation='Nearest', extent=self.extent, origin='upper',aspect='auto')
        plt.xlim(self.extent[0], self.extent[1])
        plt.ylim(self.extent[2], self.extent[3])
        # plt.vlines(self.ionogram_list[0].time, self.extent[2], self.extent[3], 'r')
        if label:
           celsius.ylabel('f / MHz')

        if colorbar:
            old_ax = plt.gca()
            plt.colorbar(
                    cax = celsius.make_colorbar_cax(), ticks=self.cbar_ticks
                ).set_label(r"$Log_{10} V^2 m^{-2} Hz^{-1}$")
            plt.sca(old_ax)
开发者ID:irbdavid,项目名称:mex,代码行数:27,代码来源:aisreview.py


示例2: draw_heatmap

def draw_heatmap(allstats, outfigure, order=None):
  conds, seqname, mean = allstats.Get(_.cond, _.seqname, _.mean)();
  df = pd.DataFrame({ 'conds': conds, 'seqname': seqname, 'mean':mean})
  df = df.pivot('conds', 'seqname', 'mean')
  plt.cla(); plt.clf();
  ax = sns.heatmap(df, center=1.0)
  plt.savefig('%s/condlibratios.svg' % output_dir)
开发者ID:thiesgehrmann,项目名称:Homokaryon-Expression,代码行数:7,代码来源:analysis.py


示例3: draw_lineplot

def draw_lineplot(x, y, title="title", xlab="x", ylab="y", odir="", xlim=None, ylim=None, outfmt='eps'):

  if len(x) == 0 or len(y) == 0:
    return;
  #fi

  plt.cla();
  plt.plot(x, y, marker='x');
  plt.xlabel(xlab);
  plt.ylabel(ylab);
  plt.title(title);

  if xlim == None:
    xmin = min(x);
    xmax = max(x);
    xlim = [xmin, xmax];
  #fi

  if ylim == None:
    ymin = min(y);
    ymax = max(y);
    ylim = [ymin, ymax];
  #fi

  plt.xlim(xlim);
  plt.ylim(ylim);

  plt.savefig('%s%s.%s' % (odir + ('/' if odir else ""), '_'.join(title.split(None)), outfmt), format=outfmt);

  return '%s.%s' % ('_'.join(title.split(None)), outfmt), title;
开发者ID:WenchaoLin,项目名称:delftrnaseq,代码行数:30,代码来源:splicing_statistics.py


示例4: draw_light_plot

def draw_light_plot():
    if "userid" not in session:
        return redirect(url_for("index"))
    uid = session["userid"]
    if uid not in users:
        return redirect(url_for("index"))
    users[uid].record_as_active()

    plt.cla()  # Clear axis
    plt.clf()  # Clear figure
    plt.close()  # Close a figure window

    # create light summary plot
    fig = plt.figure()
    ax = fig.add_subplot(111)
    users[uid].summary.plot_light(ax)
    fig.patch.set_facecolor("#fff9f0")
    fig.set_size_inches(8, 8)

    # post-process for html
    canvas = FigureCanvas(fig)
    png_output = StringIO.StringIO()
    canvas.print_png(png_output)
    response = make_response(png_output.getvalue())
    response.headers["Content-Type"] = "image/png"

    plt.cla()  # Clear axis
    plt.clf()  # Clear figure
    plt.close()  # Close a figure window
    return response
开发者ID:peterkomar-hu,项目名称:SunnyMinutes,代码行数:30,代码来源:views.py


示例5: showSkyline

def showSkyline(l):
    pylab.cla()
    for tuple in l:
        st = tuple[0]
        end = tuple[1]
        height = tuple[2]
        pylab.bar(st,height,(end-st))
    pylab.show()
    print "Done"
开发者ID:palsumitpal,项目名称:sumitpython,代码行数:9,代码来源:SkylineNew.py


示例6: draw_building_zoom

def draw_building_zoom():
    if "userid" not in session:
        return redirect(url_for("index"))
    uid = session["userid"]
    if uid not in users:
        return redirect(url_for("index"))
    users[uid].record_as_active()

    plt.cla()  # Clear axis
    plt.clf()  # Clear figure
    plt.close()  # Close a figure window

    fig = plt.figure()
    ax = fig.add_axes([0, 0, 1, 1])
    radius = ZOOM_SIZE / 2 * 1.5
    for key in users[uid].buildings:
        if users[uid].obs.distance_from_building(users[uid].buildings[key]) < radius:
            if key not in users[uid].building_keys_at_address:
                users[uid].buildings[key].plot_footprint(ax, color="k")
            else:
                users[uid].buildings[key].plot_footprint(ax, color=COLOR_LIGHTBROWN)
    users[uid].obs.plot_observers_location(ax, color="r")

    L = ZOOM_SIZE / 2  # half size of the plotted area in meters
    ax.set_xlim([users[uid].obs.x - L, users[uid].obs.x + L])
    ax.set_ylim([users[uid].obs.y - L, users[uid].obs.y + L])
    ax.xaxis.set_visible(False)
    ax.yaxis.set_visible(False)
    ax.axis("off")
    ax.set_aspect("equal")

    number_of_floors = users[uid].get_number_of_floors()
    ax.text(
        users[uid].obs.x,
        users[uid].obs.y + L / 5,
        "floors: " + str(number_of_floors),
        verticalalignment=u"center",
        horizontalalignment=u"center",
        size="large",
        color="r",
    )

    fig.patch.set_facecolor("#d4c3a8")
    fig.set_size_inches(5, 5)

    # post-process for html
    canvas = FigureCanvas(fig)
    png_output = StringIO.StringIO()
    canvas.print_png(png_output)
    response = make_response(png_output.getvalue())
    response.headers["Content-Type"] = "image/png"

    plt.cla()  # Clear axis
    plt.clf()  # Clear figure
    plt.close()  # Close a figure window
    return response
开发者ID:peterkomar-hu,项目名称:SunnyMinutes,代码行数:56,代码来源:views.py


示例7: __del__

    def __del__(self):
        """
        Figures created through the pyplot interface
        (`matplotlib.pyplot.figure`) are retained until explicitly
        closed and may co nsume too much memory.
        """

        plt.cla()
        plt.clf()
        plt.close()
开发者ID:SHINOTECH,项目名称:dicomecg_convert,代码行数:10,代码来源:ecg.py


示例8: plots

def plots(u,xvals,t):
    plt.cla()
    plt.plot(xvals,u)
    plt.ylim(-0.1, 1.1)
    plt.xlim( 0.0, 1.0)
    plt.xlabel(r'$x$',fontsize = 15)
    plt.ylabel(r'$u$',fontsize = 15)
    plt.title(r'Time: $t$ = ' + str(t).ljust(4, str(0)))
    plt.grid("on")
    fig.canvas.draw()
    return
开发者ID:coryahrens,项目名称:radiative-rg,代码行数:11,代码来源:IIPDG-diffusive-wave.py


示例9: draw_graph

def draw_graph(plot_data, rankingSystem, numberOfUv, hue):
    plot_data['world_rank'] = plot_data['world_rank'].astype(int)
    ax = sns.pointplot(x='year', y='world_rank', hue=hue, data=plot_data);
    pylab.title("Top " + str(numberOfUv) + " university by " + rankingSystem, fontsize=26)
    pylab.xticks(fontsize=20)
    pylab.yticks(fontsize=20)
    pylab.ylabel("World Rank", fontsize=26)
    pylab.xlabel("Year", fontsize=26)
    pylab.savefig('resources/images/topuv.png')
    pylab.cla()
    pylab.clf()
    pylab.close()
开发者ID:manozbiswas,项目名称:Djangoapp,代码行数:12,代码来源:views.py


示例10: mkHistogram

def mkHistogram(data,sndx):
	print type(data[2])
	histDat = pl.hist(data,360,normed=1,color='black',histtype='step',label='Angle %s' %(sndx))
	pl.legend()
	pl.xlim(-180,180)
	pl.xlabel('Angle [deg.]',fontsize=16)
	pl.ylabel('Probability density',fontsize=16)
	pl.xticks(fontsize=12)
	pl.yticks(fontsize=12)
	pl.savefig('%s_hist.pdf' %(sndx))
	pl.cla()
	return histDat # sp.histogram(data,360)
开发者ID:dzanek,项目名称:dppc,代码行数:12,代码来源:getAngle.py


示例11: plot_frequency_altitude

    def plot_frequency_altitude(self, f=2.0, ax=None, median_filter=False,
        vmin=None, vmax=None, altitude_range=(-99.9, 399.9), colorbar=False, return_image=False, annotate=True):

        if vmin is None:
            vmin = self.vmin

        if vmax is None:
            vmax = self.vmax

        if ax is None:
            ax = plt.gca()

        plt.sca(ax)
        plt.cla()
        freq_extent = (self.extent[0], self.extent[1],
            altitude_range[1], altitude_range[0])

        i = self.ionogram_list[0]
        inx = 1.0E6* (i.frequencies.shape[0] * f) / (i.frequencies[-1] - i.frequencies[0])
        img = self.tser_arr_all[:,int(inx),:]

        new_altitudes = np.arange(altitude_range[0], altitude_range[1], 14.)
        new_img = np.zeros((new_altitudes.shape[0], img.shape[1])) + np.nan

        for i in self.ionogram_list:
            e = int( round((i.time - self.extent[0]) / ais_code.ais_spacing_seconds ))

            pos = mex.iau_r_lat_lon_position(float(i.time))
            altitudes = pos[0] - ais_code.speed_of_light_kms * ais_code.ais_delays * 0.5 - mex.mars_mean_radius_km
            s = np.argsort(altitudes)
            new_img[:, e] = np.interp(new_altitudes, altitudes[s], img[s,e], left=np.nan, right=np.nan)

        plt.imshow(new_img, vmin=vmin, vmax=vmax,
            interpolation='Nearest', extent=freq_extent, origin='upper', aspect='auto')

        plt.xlim(freq_extent[0], freq_extent[1])
        plt.ylim(*altitude_range)

        ax.set_xlim(self.extent[0], self.extent[1])
        ax.xaxis.set_major_locator(celsius.SpiceetLocator())

        celsius.ylabel(r'Alt./km')
        if annotate:
            plt.annotate('f = %.1f MHz' % f, (0.02, 0.9),
                    xycoords='axes fraction', color='cyan', verticalalignment='top', fontsize='small')

        if colorbar:
            old_ax = plt.gca()
            plt.colorbar(cax = celsius.make_colorbar_cax(), ticks=self.cbar_ticks).set_label(r"$Log_{10} V^2 m^{-2} Hz^{-1}$")
            plt.sca(old_ax)

        if return_image:
            return new_img, freq_extent, new_altitudes
开发者ID:irbdavid,项目名称:mex,代码行数:53,代码来源:aisreview.py


示例12: draw_gene_isoforms

def draw_gene_isoforms(D, gene_id, outfile, outfmt):

  import matplotlib.patches as mpatches;
  from matplotlib.collections import PatchCollection;

  ISO = D[_.orig_gene == gene_id].GroupBy(_.alt_gene).Without(_.orig_gene, _.orig_exon_start, _.orig_exon_end).Sort(_.alt_gene);

  plt.cla();

  y_loc   = 0;
  y_step  = 30;
  n_iso   = ISO.alt_gene.Shape()();
  origins = np.array([ [0, y] for y in xrange((y_step * (n_iso+1)),n_iso,-y_step) ]);
  patch_h = 10;

  xlim = [ ISO.exon_start.Min().Min()(), ISO.exon_end.Max().Max()()];
  ylim = [ y_step, (y_step * (n_iso+1)) + 2*patch_h];

  patches = [];
  
  for (origin, alt_id, starts, ends, exons, retention, alt5, alt3, skipped, new, ident) in zip(origins, *ISO()):

    plt.gca().text( min(starts), origin[1] + patch_h, alt_id, fontsize=10);
    for (exon_start, exon_end, exon_coverage, exon_retention, exon_alt5, exon_alt3, exon_skipped, exon_new, exon_ident) in zip(starts, ends, exons, retention, alt5, alt3, skipped, new, ident):
      if not(exon_skipped):
        patch = mpatches.FancyBboxPatch(origin + [ exon_start, 0], exon_end - exon_start, patch_h, boxstyle=mpatches.BoxStyle("Round", pad=0), color=draw_gene_isoforms_color(exon_retention, exon_alt5, exon_alt3, exon_skipped, exon_new, exon_ident));
        text_x, text_y = origin + [ exon_start, +patch_h/2];
        annots = zip(['Retention', "Alt 5'", "Alt 3'", "Skipped", 'New'], [exon_retention, exon_alt5, exon_alt3, exon_skipped, exon_new]);
        text  = '%s: %s' %( ','.join([str(exid) for exid in exon_coverage]), '\n'.join([ s for (s,b) in annots if b]));
        plt.gca().text(text_x, text_y, text, fontsize=10, rotation=-45);
        plt.gca().add_patch(patch);

        if all(ident):
          plt.gca().plot([exon_start, exon_start], [origin[1], 0], '--k', alpha=0.3);
          plt.gca().plot([exon_end, exon_end], [origin[1], 0], '--k', alpha=0.3);
        #fi
      #fi
    #efor
  #efor

  plt.xlim(xlim);
  plt.ylim(ylim);
  plt.title('Isoforms for gene %s' % gene_id);
  plt.xlabel('Location on chromosome');
  plt.gca().get_yaxis().set_visible(False);
  plt.gca().spines['top'].set_color('none');
  plt.gca().spines['left'].set_color('none');
  plt.gca().spines['right'].set_color('none');
  plt.tick_params(axis='x', which='both', top='off', bottom='on');
  plt.savefig(outfile, format=outfmt);

  return ISO;
开发者ID:WenchaoLin,项目名称:delftrnaseq,代码行数:52,代码来源:splicing_statistics.py


示例13: drawBarAXBarChart

def drawBarAXBarChart(bar1_series, bar2_series, title, xlabel, y_bar1_label, y_bar2_label, xticklabels, bar1_label, bar2_label):
    n_groups = xticklabels.size
    fig, ax = plt.subplots(dpi=100, figsize=(16,8))

    index = np.arange(n_groups)
    bar_width = 0.25

    opacity = 0.4
    error_config = {'ecolor': '0.3'}
    def autolabel(ax, rects):
        # attach some text labels
        for rect in rects:
            height = rect.get_height()
            ax.text(rect.get_x() + rect.get_width()/2., 1.005*height,
                    '%d' % int(height),
                    ha='center', va='bottom', fontproperties=myFont, size=tipSize-1)
    rects = plt.bar(index, bar1_series, bar_width,
                    alpha=opacity,
                    color='b',
                    error_kw=error_config,
                    label=bar1_label)
    autolabel(ax,rects)              
    plt.xlabel(xlabel, fontproperties=myFont, size=titleSize)
    plt.ylabel(y_bar1_label, fontproperties=myFont, size=titleSize, color='b')
    for label in ax.get_yticklabels():
        label.set_color('b')
    plt.title(title, fontproperties=myFont, size=titleSize)
    plt.xticks(index + (1/2.)*bar_width, xticklabels, fontproperties=myFont, size=tipSize)
    plt.legend(prop=font_manager.FontProperties(fname='/Library/Fonts/Songti.ttc', size=tipSize))
    
    print 'drawNBarChart',title,'1 over'
    ax1 = ax.twinx()
    rects1 = plt.bar(index+1*bar_width, bar2_series, bar_width,
                    alpha=opacity,
                    color='r',
                    error_kw=error_config,
                    label=bar2_label, axes=ax1)
    autolabel(ax1,rects1)              
    for label in ax1.get_yticklabels():
        label.set_color('r')
    plt.ylabel(y_bar2_label, fontproperties=myFont, size=titleSize, color='r')
    plt.xticks(index + (2/2.)*bar_width, xticklabels, fontproperties=myFont, size=tipSize)
    plt.legend((rects, rects1), (bar1_label, bar2_label),prop=font_manager.FontProperties(fname='/Library/Fonts/Songti.ttc', size=tipSize))
    
    plt.tight_layout()
    
    plt.savefig(sv_file_dir+'/'+title+'.png', format='png')
    plt.cla()
    plt.clf()
    plt.close()
    print 'drawNBarChart',title,'2 over'
开发者ID:codedjw,项目名称:DataAnalysis,代码行数:51,代码来源:qyw_6th_user_analysis.py


示例14: drawPieChart

def drawPieChart(data, labels, title):
    fig = plt.figure(dpi=100, figsize=(8,8))
    # first axes
    ax1 = fig.add_axes([0.1, 0.1, 0.8, 0.8])
    patches, texts, autotexts = ax1.pie(data, labels=labels, autopct='%1.1f%%', colors=['yellowgreen', 'gold', 'lightskyblue', 'lightcoral'])
    plt.setp(autotexts, fontproperties=myFont, size=tipSize)
    plt.setp(texts, fontproperties=myFont, size=tipSize)
    ax1.set_title(title,fontproperties=myFont, size=titleSize)
    ax1.set_aspect(1)
    #plt.show()
    plt.savefig(sv_file_dir+'/'+title+'.png', format='png')
    plt.cla()
    plt.clf()
    plt.close()
    print 'drawPieChart',title,'over'
开发者ID:codedjw,项目名称:DataAnalysis,代码行数:15,代码来源:qyw_6th_user_analysis.py


示例15: draw_inverted_polar_plot

def draw_inverted_polar_plot():
    if "userid" not in session:
        return redirect(url_for("index"))
    uid = session["userid"]
    if uid not in users:
        return redirect(url_for("index"))
    users[uid].record_as_active()

    plt.cla()  # Clear axis
    plt.clf()  # Clear figure
    plt.close()  # Close a figure window

    fig = plt.figure()
    ax = fig.add_axes([0, 0, 1, 1])
    users[uid].sil.draw_inverted_polar(ax, color="k")
    this_year = dt.datetime.today().year
    dates_to_plot = [dt.datetime(this_year, 6, 21), dt.datetime.today(), dt.datetime(this_year, 12, 22)]
    morning_colors = ["#ffc469", "#fd8181", "#ffc469"]
    afternoon_colors = ["#f98536", "r", "#f98536"]
    labels = ["Jun 21", "today", "Dec 22"]
    text_colors = ["#f98536", "r", "#f98536"]
    for i in range(0, len(dates_to_plot)):
        d = dates_to_plot[i]
        cm = morning_colors[i]
        ca = afternoon_colors[i]
        ct = text_colors[i]
        l = labels[i]
        sun = SunPath(stepsize=SUN_STEPSIZE, lat=users[uid].obs.lat, lon=users[uid].obs.lon, date=d)
        sun.calculate_path()
        sun.calculate_visibility(users[uid].sil)
        sun.draw_inverted_polar(ax, morning_color=cm, afternoon_color=ca, text_color=ct, label=l)

    ax.axis("off")
    ax.set_aspect("equal")
    fig.patch.set_facecolor("#fff9f0")
    fig.set_size_inches(8, 8)

    # post-process for html
    canvas = FigureCanvas(fig)
    png_output = StringIO.StringIO()
    canvas.print_png(png_output)
    response = make_response(png_output.getvalue())
    response.headers["Content-Type"] = "image/png"

    plt.cla()  # Clear axis
    plt.clf()  # Clear figure
    plt.close()  # Close a figure window
    return response
开发者ID:peterkomar-hu,项目名称:SunnyMinutes,代码行数:48,代码来源:views.py


示例16: plot_frequency_range

    def plot_frequency_range(self, f_min=0., f_max=0.2, ax=None, median=False,
        vmin=None, vmax=None, colorbar=False, max_value=False):

        if vmin is None:
            vmin = self.vmin

        if vmax is None:
            vmax = self.vmax

        if ax is None:
            ax = plt.gca()

        plt.sca(ax)
        plt.cla()
        freq_extent = (self.extent[0], self.extent[1],
            ais_code.ais_max_delay*1E3, ais_code.ais_min_delay*1E3)

        i = self.ionogram_list[0]
        inx, = np.where((i.frequencies > f_min*1E6) & (i.frequencies < f_max*1E6))

        if inx.shape[0] < 2:
            raise ValueError("Only %d frequency bins selected." % inx.shape[0])
        print("Averaging over %d frequency bins" % inx.shape[0])

        if median:
            if inx.shape[0] < 3:
                raise ValueError("Median here only really makes sense for 3 or more bins")
            img = np.median(self.tser_arr_all[:,inx,:],1)
        elif max_value:
            img = np.max(self.tser_arr_all[:,inx,:],1)
        else:
            img = np.mean(self.tser_arr_all[:,inx,:],1)
        plt.imshow(img, vmin=vmin, vmax=vmax,
            interpolation='Nearest', extent=freq_extent, origin='upper',aspect='auto')

        plt.xlim(freq_extent[0], freq_extent[1])
        plt.ylim(freq_extent[2], freq_extent[3])
        # plt.vlines(i.time,freq_extent[2],freq_extent[3], 'r')
        celsius.ylabel(r'$\tau_D / ms$' '\n' '%.1f-%.1f MHz' % (f_min, f_max))
        # plt.annotate('f = %.1f - %.1f MHz' % (f_min, f_max), (0.02, 0.9), xycoords='axes fraction',
            # color='grey', verticalalignment='top', fontsize='small')

        if colorbar:
            old_ax = plt.gca()
            plt.colorbar(cax = celsius.make_colorbar_cax(), ticks=self.cbar_ticks).set_label(r"$Log_{10} V^2 m^{-2} Hz^{-1}$")
            plt.sca(old_ax)
开发者ID:irbdavid,项目名称:mex,代码行数:46,代码来源:aisreview.py


示例17: plot_update

def plot_update(fig, axarr, data1, data2, round):

    plt.cla()
    dota1 = data1 / STARTING_PCT
    dota2 = data2 / STARTING_PCT
    center_of_mass1 = ndimage.measurements.center_of_mass(dota1)
    center_of_mass2 = ndimage.measurements.center_of_mass(dota2)

    axarr = [plt.subplot(fig[0, 0]), plt.subplot2grid((2, 2), (1, 0), colspan=2), plt.subplot(fig[0, 1])]
    img1 = axarr[0].imshow(
        dota1,
        interpolation="nearest",
        cmap=plt.cm.ocean,
        extent=(0.5, np.shape(dota1)[0] + 0.5, 0.5, np.shape(dota1)[1] + 0.5),
    )
    axarr[0].plot([center_of_mass1[1]], [center_of_mass1[0]], "or")  # adds dot at center of mass
    axarr[0].plot([center_of_mass2[1]], [center_of_mass2[0]], "oy")  # adds dot for other teams c o m
    axarr[0].axis((1, 101, 1, 101))
    axarr[1].plot(avg_deal_data1, color="green")
    axarr[1].set_xlim(0, rounds)
    axarr[1].set_title("Current Round:" + str(round))
    axarr[0].set_title("Player1")
    axarr[2].set_title("Player2")
    axarr[0].set_ylabel("Give")
    axarr[0].set_xlabel("Accept")
    axarr[1].set_ylabel("Average Cash per Deal")
    axarr[1].set_xlabel("Round Number")
    plt.colorbar(img1, ax=axarr[0], label="Prevalence vs. Uniform")

    img2 = axarr[2].imshow(
        dota2,
        interpolation="nearest",
        cmap=plt.cm.ocean,
        extent=(0.5, np.shape(dota2)[0] + 0.5, 0.5, np.shape(dota2)[1] + 0.5),
    )
    axarr[2].plot([center_of_mass2[1]], [center_of_mass2[0]], "or")  # adds dot at center of mass
    axarr[2].plot([center_of_mass1[1]], [center_of_mass1[0]], "oy")  # adds dot for other teams c o m
    axarr[2].axis((1, 101, 1, 101))
    axarr[1].plot(avg_deal_data2, color="purple")

    plt.title("Current Round:" + str(round))
    axarr[2].set_ylabel("Give")
    axarr[2].set_xlabel("Accept")
    plt.colorbar(img2, ax=axarr[2], label="Prevalence vs. Uniform")

    plt.draw()
开发者ID:Frybo,项目名称:msc-dissertation,代码行数:46,代码来源:ryansim_2pop_002.py


示例18: mkProfile

def mkProfile(hvals,sndx):
	xval = hvals[1][:-1]
	yval = hvals[0]
	yval = [-0.0019*float(300)*np.log(i) for i in yval]
	minVal = float(min(yval))
	yval = [i-minVal for i in yval]
	yvalS = smoothData(yval,10)
	pl.plot(xval,yval,'.',color='black',label='Calculated %s' %(sndx))
	pl.plot(xval,yvalS,'-',color='black',label='Smooth %s' %(sndx))
	pl.legend()
	pl.xlim(-180,180)
	pl.ylim(0,6)
        pl.xlabel('Angle [deg.]',fontsize=16)
        pl.ylabel('Energy [kcal/mol/deg2',fontsize=16)
	pl.xticks(fontsize=12)
        pl.yticks(fontsize=12)
        pl.savefig('%s_prof.pdf' %(sndx))
        pl.cla()
开发者ID:dzanek,项目名称:dppc,代码行数:18,代码来源:getAngle.py


示例19: draw_hist

def draw_hist(x, title="title", xlab="x", ylab="y", normed=True, odir="", nbins=None, outfmt='eps'):

  if len(x) == 0:
    return;
  #fi

  plt.cla();
  if nbins:
    plt.hist(x, nbins, normed=normed);
  else:
    plt.hist(x, normed=normed);
  #fi
  plt.xlabel(xlab);
  plt.ylabel(ylab);
  plt.title(title);

  plt.savefig('%s%s.%s' % (odir + ('/' if odir else ""), '_'.join(title.split(None)), outfmt), format=outfmt);

  return '%s.%s' % ('_'.join(title.split(None)), outfmt), title;
开发者ID:WenchaoLin,项目名称:delftrnaseq,代码行数:19,代码来源:splicing_statistics.py


示例20: density_of_accessing

def density_of_accessing(picture_name):
    
    coordinats = []
    with open("matrix_processing_result.log") as file:
        for line in file:
            coordinats.append(list(map(int, line.split() )))

    xlist, ylist = zip(*coordinats)
    xlist = np.array(xlist)
    ylist = np.array(ylist)

    heatmap, xedges, yedges = np.histogram2d(xlist, ylist, bins=150)
    extent = [xedges[0], xedges[-1], yedges[0], yedges[-1]]

    plt.clf()
    plt.cla()
    plt.imshow(heatmap, extent=extent)

    plt.savefig(picture_name)
开发者ID:AlexeiBuzuma,项目名称:AHPP,代码行数:19,代码来源:script.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python pylab.clf函数代码示例发布时间:2022-05-27
下一篇:
Python pylab.bar函数代码示例发布时间: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