本文整理汇总了Python中pylab.rc函数的典型用法代码示例。如果您正苦于以下问题:Python rc函数的具体用法?Python rc怎么用?Python rc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rc函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: fooplot
def fooplot(curs,ax1=None,ax2=None):
#P.figure(figsize=(10,4.96))
if not ax1: ax1=P.axes([0.38,0.01,0.30,0.32])
if not ax2: ax2=P.axes([0.68,0.01,0.31,0.32],sharey=ax1)
P.rc('xtick.major', pad=-12)
P.rc('xtick', labelsize=10)
curs.execute('SELECT DISTINCT sid,z,Ha_w from sel ORDER BY fuv_lum desc')
data=curs.fetchall()
for sid,z,ha in data:
fuv,beta=curs.execute('select max(fuv_lum),beta from sel where objID=%s'%sid).fetchone()
if ha < 70: color='g';marker='o'
elif ha > 70 and ha < 140: color='y';marker='s'
elif ha > 140: color='r';marker='D'
ax1.plot(-1*(beta or N.nan),N.log10(fuv),color=color,marker=marker)
ax2.plot(N.log10(ha),N.log10(fuv),color=color,marker=marker)
P.setp(ax1.get_yticklabels(), visible=False)
P.setp(ax2.get_yticklabels(), fontsize=10)
ax1.xaxis.labelpad=-19
ax2.xaxis.labelpad=-19
ax2.set_xlabel(r'$\log\,W(H_\alpha)$')
ax1.set_ylabel(r'$\log(L_{FUV})$')
ax1.set_xlabel(r'$\beta$')
ax1.axis([-0.4,-1.8,8.75,10.45])
ax2.axis([1.55,2.45,8.75,10.45])
ax1.set_yticks([8.8, 9.2, 9.6,10,10.4])
ax1.set_xticks([-0.5,-1.0,-1.5])
ax2.set_xticks([1.8,2.0,2.2,2.4])
开发者ID:ivh,项目名称:PyStarburst,代码行数:30,代码来源:galex.py
示例17: myfig
def myfig( fig, small=True, marker=False ):
all_defaults = get_all_defaults( small )
params = get_params( small )
pylab.rcParams.update( params )
pylab.rc('font', **all_defaults[ 'font' ])
for i, line in enumerate( fig.axes[0].lines ):
defaults = get_defaults( i )
keys = defaults.keys()
keys.sort()
for k in keys:
k2=k
if k.find('_marker') > -1:
if marker:
k2 = k[:-7]
else:
continue
attr = getattr( line, 'set_' + k2, 'NOTFOUND' )
if attr == 'NOTFOUND':
continue
attr( defaults[ k ] )
leg = fig.axes[0].legend()
if leg <> None:
leg.set_visible(True)
pylab.ion()
return fig
开发者ID:naphazg,项目名称:matplotlib_routines,代码行数:25,代码来源:plot_defaults.py
示例18: plot
def plot(self):
specs = pl.array( list(set([ l['spec'] for l in self.lines ])) )
specs.sort()
self.specs = specs
pl.figure()
pl.hold('on')
pl.grid('on')
pl.jet()
lines = []
lines_spec = list(pl.zeros(len(specs)))
for i in range(0,len(self.lines)):
ispc = pl.find( specs == self.lines[i]['spec'] )
self.colr = pl.cm.get_cmap()( float(ispc)/len(specs) )
wl = self.lines[i]['wave']
ri = float(self.lines[i]['rel_int'])
lines.append( pl.plot( [wl, wl], [0., ri if not isnan(ri) else 0.], '.-', color=self.colr )[0] )
lines_spec[ispc] = lines[-1]
datacursor(lines,formatter='x={x:8.3f}\ny={y:8.3f}'.format)
pl.rc('text',usetex=True)
pl.xlabel('$\lambda ~ [\AA]$')
pl.ylabel('relative intensity [arb]')
pl.title('Spectrum for '+self.spec+' from NIST ASD')
if len(specs) > 1:
pl.legend( lines_spec,specs )
pl.show()
开发者ID:atronchi,项目名称:NISTASD,代码行数:30,代码来源:NISTASD.py
示例19: plot_dis_sessions
def plot_dis_sessions(sessions):
fig=plt.figure(figsize=(12, 10), dpi=80)
leg=[]
sum=np.zeros(22)
count =np.zeros(22)
for i in range(0,len(sessions)-1):
for j in range(i+1,len(sessions)):
userA= get_rating_vector(sessions[i])
userB= get_rating_vector(sessions[j])
if len(userA)<len(userB):
userB=userB[:len(userA)]
elif len(userA)>len(userB):
userA=userA[:len(userB)]
# leg.append( ' vs '.join( [ get_name_from_session(sessions[i]) , get_name_from_session(sessions[j])]))
dis=[get_kappa(A, B) for A,B in zip(userA, userB)]
dis.append(0)
dis=dis[-1:] + dis[:-1]
sum[:len(dis)] += np.array(dis)
count[:len(dis)] +=1
idx= np.where(count)
meandis= sum[idx]/count[idx]
plt.plot(range(len(meandis)),meandis,linewidth=2)
plt.rc('font', **{'family': 'serif', 'size':20, 'serif': ['Computer Modern']})
# plt.rc('text', usetex=True)
plt.xlabel('Iteration',fontsize=30)
plt.title('Avg Pairwise Disagreement between Subjects ',fontsize=30, y=1.02)
plt.ylabel('$\kappa$',fontsize=30)
plt.grid()
plt.savefig(path+'dis.png')
plt.xlim([-0.5,plt.xlim()[1]+1])
plt.ylim([-0.1,plt.ylim()[1]+1])
plt.legend(['Avg Pairwise Disagreement'])
plt.show()
开发者ID:airanmehr,项目名称:biocaddie,代码行数:34,代码来源:multiclass-classification.py
示例20: plot_measurements
def plot_measurements(time_points, ydata):
pl.rc("text", usetex = True)
pl.rc("font", family="serif")
pl.subplot2grid((4, 2), (0, 0))
pl.plot(time_points, ydata[:,0])
pl.title("Considered measurement data")
pl.xlabel("t")
pl.ylabel("X", rotation = 0, labelpad = 20)
pl.subplot2grid((4, 2), (1, 0))
pl.plot(time_points, ydata[:,1])
pl.xlabel("t")
pl.ylabel("Y", rotation = 0, labelpad = 15)
pl.subplot2grid((4, 2), (2, 0))
pl.plot(time_points, ydata[:,2])
pl.xlabel("t")
pl.ylabel(r"\phi", rotation = 0, labelpad = 15)
pl.subplot2grid((4, 2), (3, 0))
pl.plot(time_points, ydata[:,3])
pl.xlabel("t")
pl.ylabel("v", rotation = 0, labelpad = 20)
pl.subplot2grid((4, 2), (0, 1), rowspan = 4)
pl.plot(ydata[:,0], ydata[:, 1])
pl.title("Considered racecar track (measured)")
pl.xlabel("X")
pl.ylabel("Y", rotation = 0, labelpad = 20)
pl.show()
开发者ID:adbuerger,项目名称:casiopeia,代码行数:32,代码来源:casiopeia_demo.py
注:本文中的pylab.rc函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论