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


Python pylab.rc函数代码示例

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


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

示例1: plot_all

def plot_all():
	from pylab import xlabel, ylabel, xlim, ylim, subplot, title, rc
	rc('text', usetex=True)
	subplot(141)
	title(r'(a)')
	plot_poly('xi',1,[.1,.2,.3],[.1,-10,-.5])
	xlabel(r'$\xi$')
	ylabel(r'$p_\xi$')
	subplot(142)
	title(r'(b)')
	plot_poly('xi',1,[.6,.2,.3],[.1,.5,-.5])
	xlim(-3,3)
	ylim(-12,12)
	xlabel(r'$\xi$')
	ylabel(r'$p_\xi$')
	subplot(143)
	title(r'(c)')
	plot_poly('xi',1,[.8,.2,.3],[.1,.5,-.5])
	xlim(-3,3)
	ylim(-12,12)
	xlabel(r'$\xi$')
	ylabel(r'$p_\xi$')
	subplot(144)
	title(r'(d)')
	plot_poly('eta',1,[70.,.2,.3],[.1,.5,-.5])
	xlim(-10,10)
	ylim(-200,200)
	xlabel(r'$\eta$')
	ylabel(r'$p_\eta$')
开发者ID:bluescarni,项目名称:stark_weierstrass,代码行数:29,代码来源:plotting.py

示例2: plot_io_obliquity_2

def plot_io_obliquity_2():
	from numpy import linspace, array, arange
	from pylab import rc, plot, xlim, xticks, xlabel, ylabel
	import matplotlib.pyplot as plt
	import mpmath
	rc('text', usetex=True)
	fig = plt.figure()
	# Initial params.
	#params = {'m2':1.9e27,'r2':70000.e3,'rot2':0.00017585125448028,\
	#	'r1':1,'rot1':6.28*100,'i_a':0.5,'ht': 0,\
	#	'a':421700E3 / 4,'e':0.01,'i':0.8,'h':2}
	params = {'m2':1.9e27,'r2':70000.e3,'rot2':0.00017585125448028,\
		'r1':1821E3,'rot1':6.28/(21 * 3600),'i_a':0.17453,'ht': 0,\
		'a':421700E3,'e':0.05,'i':0.349,'h':0.35}
	# Set parameters.
	sp.parameters = params
	# Period.
	period = sp.wp_period
	ob = sp.obliquity_time
	lspace = linspace(0,5*period,250)
	xlim(0,float(lspace[-1]))
	xlabel(r'$\textnormal{Time (Ma)}$')
	ylabel(r'$\textnormal{Obliquity }\left( ^\circ \right)$')
	ob_series = array([ob(t).real*(360/(2*mpmath.pi())) for t in lspace])
	plot(lspace,ob_series,'k-',linewidth=2)
	xticks(arange(xlim()[0],xlim()[1],365*24*3600*1000000),[r'$'+str(int(_)*1)+r'$' for _ in [t[0] for t in enumerate(arange(xlim()[0],xlim()[1],365*24*3600*1000000))]])
开发者ID:bluescarni,项目名称:restricted_2body_1pn_angular,代码行数:26,代码来源:plot_applications.py

示例3: sim_results

def sim_results(obs, modes, stars, model, data):


    synth = model.generate_data(modes)
    synth_stats = model.summary_stats(synth)
    obs_stats = model.summary_stats(obs)


    f = plt.figure(figsize=(15,3))
    plt.suptitle('Obs Cand.:{}; Sim Cand.:{}'.format(obs.size, synth.size))
    plt.rc('legend', fontsize='xx-small', frameon=False)
    plt.subplot(121)
    bins = opt_bin(obs_stats[0],synth_stats[0])
    plt.hist(obs_stats[0], bins=bins, histtype='step', label='Data', lw=2)
    plt.hist(synth_stats[0], bins=bins, histtype='step', label='Simulation', lw=2)
    plt.xlabel(r'$\xi$')
    plt.legend()

    plt.subplot(122)
    bins = opt_bin(obs_stats[1],synth_stats[1])
    plt.hist(obs_stats[1], bins=np.arange(bins.min()-0.5, bins.max()+1.5,
                                          1),
             histtype='step', label='Data', log=True, lw=2)
    plt.hist(synth_stats[1], bins=np.arange(bins.min()-0.5, bins.max()+1.5,
                                            1),
             histtype='step', label='Simulation', log=True, lw=2)
    plt.xlabel(r'$N_p$')
    plt.legend()
开发者ID:rcmorehead,项目名称:simplanets,代码行数:28,代码来源:abcplot.py

示例4: plot_masses

def plot_masses(ps, rs, scs, save=False, name=''):
    p.figure
    p.rc('text', usetex=True)
    p.rc('font', size=18)
    p.xlabel('$am_1 + am_2$')
    p.ylabel('$aM_{vs}$')
    legend = ()
    
    # Pions.
    xs, ys, es = zip(*[q.pt for q in ps])  # Unpack data.
    legend += p.errorbar(xs, ys, es, fmt='o')[0],

    # Rhoxs.
    #xs, ys, es = zip(*[r.pt for r in rxs])  # Unpack data.
    #legend += p.errorbar(xs, ys, es, fmt='o')[0],

    # Rhos.
    xs, ys, es = zip(*[r.pt for r in rs])  # Unpack data.
    legend += p.errorbar(xs, ys, es, fmt='o')[0],

    # Scalars.
    xs, ys, es = zip(*[r.pt for r in scs])  # Unpack data.
    legend += p.errorbar(xs, ys, es, fmt='o')[0],
    
    p.legend(legend, ('$\pi$', r'$\rho$', '$a_0$'), 'best')
    if save:
        p.savefig(name)
    else:
        p.show()
开发者ID:atlytle,项目名称:tifr,代码行数:29,代码来源:analyze_mixed_pions.py

示例5: plot_probe_earth_obliquity

def plot_probe_earth_obliquity():
	from numpy import linspace, array, arange
	from pylab import rc, plot, xlim, xticks, xlabel, ylabel
	import matplotlib.pyplot as plt
	import mpmath
	rc('text', usetex=True)
	fig = plt.figure()
	# Initial params.
	#params = {'m2':5.97E24,'r2':6371.e3,'rot2':6.28/(24.*3600),\
		#'r1':0.038,'rot1':6.28*3500/60,'i_a':0.5,'ht': 0,\
		#'a':7027E3,'e':0.01,'i':0.8,'h':2}
	params = {'m2':5.97E24,'r2':6371.e3,'rot2':6.28/(24.*3600),\
		'r1':0.038,'rot1':6.28*3400/60,'i_a':90.007 * 2*mpmath.pi()/360,'ht': 0,\
		'a':7013E3,'e':0.0014,'i':mpmath.pi()/2,'h':-mpmath.pi()/2}
	# Set parameters.
	sp.parameters = params
	# Period.
	period = sp.wp_period
	ob = sp.obliquity_time
	lspace = linspace(0,5*period,250)
	xlim(0,float(lspace[-1]))
	xlabel(r'$\textnormal{Time (ka)}$')
	ylabel(r'$\textnormal{Obliquity }\left( ^\circ \right)$')
	ob_series = array([ob(t).real*(360/(2*mpmath.pi())) for t in lspace])
	plot(lspace,ob_series,'k-',linewidth=2)
开发者ID:bluescarni,项目名称:restricted_2body_1pn_angular,代码行数:25,代码来源:plot_applications.py

示例6: computePlotROCs

def computePlotROCs(paths,mode,mutpaths):
	allalphas = set()
	exps = []
	pylab.rc('text', usetex=True)
	for i in range(len(paths)):
		path = paths[i]
		mutpath = mutpaths[i]
		mutseq = open(mutpath,"r").readlines()[0]
		seq,struc,nbMut,profiles = loadMutationalProfiles(path)
		mutpos = getMutatedPositions(seq,mutseq)
		exps.append((path,mutseq,seq,struc,nbMut,profiles,mutpos))
		allalphas.update(profiles.keys())
	rocs = []
	lbls = []
	alphas = list(allalphas)
	alphas.sort()
	for alpha in alphas:
		c = []
		delta = 0
		for (path,mutseq,seq,struc,nbMut,profiles,mutpos) in exps:
			c += classifyProfile(profiles[alpha],seq,struc,mode,mutseq)
			delta += evaluatePrediction(profiles[alpha],seq,len(mutpos))
		roc = ROCData(c)
		rocs.append(roc)
		lbls.append("$\\alpha=%.1f,$ {\\sf AUC} $=%.1f\\%%$"%(alpha,(100.*roc.auc(0))))
		if len(paths)==1:
			cap = paths[0].split(os.sep)[-1]
		else:
			cap = "Multiple"
		print "%s\t%s\t%s\t%.2f\t%s\t%s\t%s" % (cap,mode,alpha,(100.*roc.auc(0)),delta,nbMut,len(mutpos))
	plt = plot_multiple_roc(rocs,"", lbls) 
	return plt
开发者ID:McGill-CSB,项目名称:RNApyro,代码行数:32,代码来源:createROC.py

示例7: plot_dwaf_data

def plot_dwaf_data(realtime, file_name='data_plot.png', gauge=True):
    x = pl.date2num(realtime.date)
    y = realtime.q

    pl.clf()
    pl.figure(figsize=(7.5, 4.5))
    pl.rc('text', usetex=True)# TEX fonts
    pl.plot_date(x,y,'b-',linewidth=1)
    pl.grid(which='major')
    pl.grid(which='minor')

    if gauge:
        pl.ylabel(r'Flow rate (m$^3$s$^{-1}$)')
        title = 'Real-time flow -- %s [%s]' % (realtime.station_id[0:6], realtime.station_desc)
    else:
        title = 'Real-time capacity -- %s [%s]' % (realtime.station_id[0:6], realtime.station_desc)
        pl.ylabel('Percentage of F.S.C')

    labeled_days = DayLocator(interval=3)
    ticked_days = DayLocator()
    dayfmt = DateFormatter('%d/%m/%Y')

    ax = pl.gca()
    ax.xaxis.set_major_locator(labeled_days)
    ax.xaxis.set_major_formatter(dayfmt)
    ax.xaxis.set_minor_locator(ticked_days)

    pl.xticks(fontsize=10)
    pl.yticks(fontsize=10)

    pl.title(title, fontsize=14)

    pl.savefig(file_name, dpi=100)
开发者ID:pkaza,项目名称:SAHGutils,代码行数:33,代码来源:dwafdata.py

示例8: plot_ge

def plot_ge( name_plot ):

	# distance between axes and ticks
	pl.rcParams['xtick.major.pad']='8'
	pl.rcParams['ytick.major.pad']='8'

	# set latex font
	pl.rc('text', usetex=True)
	pl.rc('font', **{'family': 'serif', 'serif': ['Computer Modern'], 'size': 20})


	pl.close('all')
	fig = pl.figure(figsize=(10.0, 5.0))
	ax = fig.add_subplot(111)
	fig.suptitle('GE, Janaury-February 2007', fontsize=20, fontweight='bold')

	den = 0.008
	N_max_day = 50
	
	sel_side = (df_ge.side==1) & (df_ge.day_trade_n < N_max_day)
	df_ge_buy = df_ge[sel_side]
	pl.hlines(df_ge_buy.day_trade_n, df_ge_buy.mm_s, df_ge_buy.mm_e, linestyles='solid', lw= pl.array(df_ge_buy.eta/den), color='blue', alpha=0.3)

	sel_side = (df_ge.side==-1) & (df_ge.day_trade_n < N_max_day)
	df_ge_sell = df_ge[sel_side]
	pl.hlines(df_ge_sell.day_trade_n, df_ge_sell.mm_s, df_ge_sell.mm_e, linestyles='solid', lw= pl.array(df_ge_sell.eta/den), color='red', alpha=0.3)


	ax.set_xlim([0,390])
	ax.set_ylim([N_max_day,-1])
	ax.set_aspect('auto')
	ax.set_xlabel('Trading minute')
	ax.set_ylabel('Trading day')
	pl.subplots_adjust(bottom=0.15)
	pl.savefig("../plot/" + name_plot + ".pdf")
开发者ID:patricktersh,项目名称:bmll,代码行数:35,代码来源:imp_tmp.py

示例9: generate

def generate(sample_sequence_tuples, save_path = None):
    samples = [x[0] for x in sample_sequence_tuples]
    number_of_sequences = [x[1] for x in sample_sequence_tuples]

    pos = pylab.arange(len(number_of_sequences))+.5

    width = len(samples) / 5
    if width < 5:
        width = 5

    if width > 15:
        width = 15

    fig = pylab.figure(figsize=(width, 4))

    pylab.rcParams.update({'axes.linewidth' : 0, 'axes.axisbelow': False})
    pylab.rc('grid', color='0.80', linestyle='-', linewidth=0.1)
    pylab.grid(True)
    pylab.bar(pos, number_of_sequences, align='center', color='#EFADAD', linewidth=0.1)
    pylab.xticks(pos, samples, rotation=90, size='xx-small')
    pylab.xlim(xmax=len(samples))
    pylab.yticks(size='xx-small')
    pylab.ylabel('Number of sequences (%d samples)' % len(samples), size="small")

    if save_path:
        pylab.savefig(save_path)
    else:
        pylab.show()
开发者ID:ShannonCeb,项目名称:viamics,代码行数:28,代码来源:bar.py

示例10: plot_benchmark_time_per_frame

def plot_benchmark_time_per_frame(ball_quantities, benchmark_results,
                                  title, pic_filename):
    import pylab
    fig = pylab.figure(figsize=(6.0, 11.0)) #size in inches
    fig.suptitle(title, fontsize=12)

    pylab.axis([0.0, 500, -10 * len(benchmark_results), 150]) # axis extension
    pylab.rc('axes', linewidth=3)     # thickening axes
 
    # axis labels
    pylab.xlabel(r"num balls", fontsize = 12, fontweight='bold')
    pylab.ylabel(r"time per frame in ms", fontsize = 12, fontweight='bold')

    # plot cases
    x = ball_quantities
    case_names = [ k for k in benchmark_results]
    case_names.sort()
    colors = [ 'b', 'r', 'g', 'm', '#95B9C7', '#EAC117', '#827839' ]
    for case, color in zip(case_names, colors):
        # convert time to ms
        res = [ v*1000 for v in benchmark_results[case]] 
        pylab.plot(x, res, color=color, label=case)

    # show the plot labels
    pylab.legend(loc='lower center')

    #pylab.show() # show the figure in a new window
    pylab.savefig(pic_filename)
开发者ID:DatRollingStone,项目名称:nwidget,代码行数:28,代码来源:a0_benchmark_time_per_frame.py

示例11: plot_tmp_imp

def plot_tmp_imp( name_plot ):

	# distance between axes and ticks
	pl.rcParams['xtick.major.pad']='8'
	pl.rcParams['ytick.major.pad']='8'

	# set latex font
	pl.rc('text', usetex=True)
	pl.rc('font', **{'family': 'serif', 'serif': ['Computer Modern'], 'size': 20})

	# plotting
	x_plf = pow(10,pl.linspace(-6,0,1000))

	pl.clf()
	p_pl, = pl.plot(x_plf,ff_pl(x_plf,par_pl[0],par_pl[1]), ls='--', color='Red')
	p_lg, = pl.plot(x_plf,ff_lg(x_plf,par_lg[0],par_lg[1]), ls='-', color='RoyalBlue')
	p_points, = pl.plot(df_imp_1d.pi,df_imp_1d.imp,'.', color='Black',ms=10)
	pl.xscale('log')
	pl.yscale('log')
	pl.xlabel('$\phi$')
	pl.ylabel('$\mathcal{I}_{tmp}(\Omega=\{ \phi \})$')
	pl.grid()
	pl.axis([0.00001,1,0.0001,0.1])

	leg_1 = '$\hat{Y} = $' + str("%.4f" % round(par_pl[0],4)) + '$\pm$' + str("%.4f" % round(vv_pl[0][0],4)) + ' $\hat{\delta} = $' + str("%.4f" % round(par_pl[1],4)) + '$\pm$' + str("%.4f" % round(vv_pl[1][1],4)) + ' $E_{RMS} = $' + str("%.4f" % round(pl.sqrt(chi_pl/len(df_imp_1d.imp)),4))
	leg_2 = '$\hat{a} = $' + str("%.3f" % round(par_lg[0],3)) + '$\pm$' + str("%.3f" % round(vv_lg[0][0],3)) + ' $\hat{b} = $' + str("%.0f" % round(par_lg[1],3)) + '$\pm$' + str("%.0f" % round(vv_lg[1][1],3)) + ' $E_{RMS} = $' + str("%.4f" % round(pl.sqrt(chi_lg/len(df_imp_1d.imp)),4))
	l1 = pl.legend([p_pl,p_lg], ['$f(\phi) = Y\phi^{\delta}$', '$g(\phi)= a \log_{10}(1+b\phi)$'], loc=2, prop={'size':15})
	l2 = pl.legend([p_pl,p_lg], [leg_1 ,leg_2 ], loc=4, prop={'size':15})
	pl.gca().add_artist(l1)
	pl.subplots_adjust(bottom=0.15)
	pl.subplots_adjust(left=0.17)
	pl.savefig("../plot/" + name_plot + ".pdf")
开发者ID:patricktersh,项目名称:bmll,代码行数:32,代码来源:imp_tmp.py

示例12: plot

def plot(t, inp, target, wavenet, param, orig=None, xlabel='', ylabel=''):
    plb.rc('font', family='serif')
    plb.rc('font', size=13)
    plb.figure('Апроксимация')
    plb.subplot(212)
    plb.plot(t, target, label='Модельный сигнал')
    if orig is not None:
        plb.plot(t, orig, label='Оригинал')
    plb.plot(t, wavenet.sim(t, inp), linestyle='--', label='Аппроксимация')
    plb.legend(loc=0)
    plb.subplot(211)
    plb.title('Суммарная квадратичная ошибка')
    plb.plot(param['e'][0])
    plb.xlabel('Эпохи')

    plb.figure("Основные веса")
    plb.subplot(131)
    plb.title('Масштабы, a')
    plb.plot(np.transpose(param['a']))
    plb.subplot(132)
    plb.title('Сдвиги, b')
    plb.plot(np.transpose(param['b']))
    plb.subplot(133)
    plb.title('Веса, w')
    plb.plot(np.transpose(param['w']))
    plb.figure("Расширенные веса")
    plb.subplot(121)
    plb.title('Параметры, p')
    plb.plot(np.transpose(param['p']))
    plb.subplot(122)
    plb.title('Смещение, c')
    plb.plot(param['c'][0])
开发者ID:abalckin,项目名称:cwavenet,代码行数:32,代码来源:tool.py

示例13: graph_file

def graph_file(obj, func_name, param, range, highlights):
    ## plots the named function on obj, taking param over its range (start, end)
    ## highlights are pairs of (x_value, "Text_to_show") to annotate on the graph plot
    ## saves the plot to a file and returns full file name

    import numpy, pylab

    func = getattr(obj, func_name)
    f = numpy.vectorize(func)
    x = numpy.linspace(*range)
    y = f(x)
    pylab.rc('font', family='serif', size=20)
    pylab.plot(x, y)
    pylab.xlabel(param)
    pylab.ylabel(func_name)
    hi_pts = [pt for pt, txt in highlights]
    pylab.plot(hi_pts, f(hi_pts), 'rD')
    for pt, txt in highlights:
        pt_y = func(pt)
        ann = txt + "\n(%s,%s)" % (pt, pt_y)
        pylab.annotate(ann, xy=(pt, pt_y))

    import os, time

    file = os.path.dirname(__file__) + "/generated_graphs/%s.%s.%s.pdf" % (type(obj).__name__, func_name, time.time())
    pylab.savefig(file, dpi=300)
    pylab.close()
    return file
开发者ID:kdz,项目名称:pystemm,代码行数:28,代码来源:model.py

示例14: plot_color_maps

def plot_color_maps(reverse=False):
    """
    Simple plotting function to run through and plot each color map
    Help for choosing which colormap to use
    """
    import pylab as plt
    from numpy import outer
    plt.rc('text', usetex=False)
    a=outer(plt.ones(10,),plt.arange(0,1,0.01))
    plt.figure(figsize=(5,15))
    plt.subplots_adjust(top=0.8,bottom=0.08,left=0.03,right=0.99)
    if reverse:
        maps=[m for m in plt.cm.datad]
        rr = 2
    else:
        maps=[m for m in plt.cm.datad if not m.endswith("_r")]
        rr = 1
    maps.sort()
    l=len(maps)+1
    title_dict = {'fontsize': 10,
                  'verticalalignment': 'center',
                  'horizontalalignment': 'left'}
    for i, m in enumerate(maps):
        plt.subplot(l,rr,i+1)
        plt.axis("off")
        plt.imshow(a,aspect='auto',cmap=plt.get_cmap(m),origin="lower")
        plt.text(1.01,0.5,m,fontdict=title_dict,transform=plt.gca().transAxes)
开发者ID:samuelleblanc,项目名称:python_codes,代码行数:27,代码来源:plotting_utils.py

示例15: plot_objectivefunctiontraces

def plot_objectivefunctiontraces(results,evaluation,algorithms,filename='Like_trace'):
    import matplotlib.pyplot as plt
    from matplotlib import colors
    cnames=list(colors.cnames)
    font = {'family' : 'calibri',
        'weight' : 'normal',
        'size'   : 20}
    plt.rc('font', **font)   
    fig=plt.figure(figsize=(16,3))
    xticks=[5000,15000]
    
    for i in range(len(results)):
        ax  = plt.subplot(1,len(results),i+1)
        likes=calc_like(results[i],evaluation)  
        ax.plot(likes,'b-')
        ax.set_ylim(0,25)
        ax.set_xlim(0,len(results[0]))
        ax.set_xlabel(algorithms[i])
        ax.xaxis.set_ticks(xticks)
        if i==0:
            ax.set_ylabel('RMSE')
            ax.yaxis.set_ticks([0,10,20])   
        else:
            ax.yaxis.set_ticks([])        
        
    plt.tight_layout()
    fig.savefig(str(filename)+'.png')
开发者ID:kbstn,项目名称:spotpy,代码行数:27,代码来源:analyser.py


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