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

Python pylab.ticklabel_format函数代码示例

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

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



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

示例1: aa

 def aa(current_data):
     from pylab import ticklabel_format, xticks, gca, cos, pi
     plotcc(current_data)
     title_hours(current_data)
     ticklabel_format(format='plain',useOffset=False)
     xticks(rotation=20)
     a = gca()
     a.set_aspect(1./cos(41.75*pi/180.))
开发者ID:clawpack,项目名称:csdms,代码行数:8,代码来源:setplot.py


示例2: plotraw

 def plotraw(self):
     """quickly plots the raw isotope pattern (with mass defects preserved)"""
     import pylab as pl
     pl.bar(self.rawip[0],self.rawip[1],width=0.0001)
     pl.xlabel('m/z', style='italic')
     pl.ylabel('normalized intensity')
     pl.ticklabel_format(useOffset=False)
     pl.show()
开发者ID:Yeungdb,项目名称:mass-spec-python-tools,代码行数:8,代码来源:_Molecule.py


示例3: aa

    def aa(current_data):
        from pylab import ticklabel_format, xticks, gca, cos, pi, savefig

        title_hours(current_data)
        ticklabel_format(format="plain", useOffset=False)
        xticks(rotation=20)
        a = gca()
        a.set_aspect(1.0 / cos(46.349 * pi / 180.0))
开发者ID:dlgeorge,项目名称:geoclawapps,代码行数:8,代码来源:setplot.py


示例4: aa_innerprod

 def aa_innerprod(current_data):
     from pylab import ticklabel_format, xticks, gca, cos, pi, yticks
     plotcc(current_data)
     title_innerproduct(current_data)
     ticklabel_format(format='plain',useOffset=False)
     xticks([180, 200, 220, 240], rotation=20, fontsize = 28)
     pylab.tick_params(axis='y', labelleft='off')
     a = gca()
     a.set_aspect(1./cos(41.75*pi/180.))
开发者ID:ortegagingrich,项目名称:adjoint,代码行数:9,代码来源:setplot.py


示例5: aa

 def aa(current_data):
     from pylab import ticklabel_format, xticks, gca, cos, pi, yticks
     plotcc(current_data)
     title(current_data)
     ticklabel_format(format='plain',useOffset=False)
     xticks([180, 200, 220, 240], rotation=20, fontsize = 28)
     yticks(fontsize = 28)
     a = gca()
     a.set_aspect(1./cos(41.75*pi/180.))
开发者ID:ortegagingrich,项目名称:adjoint,代码行数:9,代码来源:setplot.py


示例6: plotbar

 def plotbar(self):
     """quickly plots a bar plot of the isotope bar pattern"""
     import pylab as pl
     fwhm = self.em/self.ks['res']
     pl.bar(self.barip[0], self.barip[1], width=fwhm, align='center')
     pl.xlabel('m/z', style='italic')
     pl.ylabel('normalized intensity')
     pl.ticklabel_format(useOffset=False)
     pl.show()
开发者ID:Yeungdb,项目名称:mass-spec-python-tools,代码行数:9,代码来源:_Molecule.py


示例7: fixup

 def fixup(current_data):
     import pylab
     #addgauges(current_data)
     t = current_data.t
     t = t / 3600.  # hours
     pylab.title('Surface at %4.2f hours' % t, fontsize=20)
     pylab.ticklabel_format(format='plain',useOffset=False)
     mean_lat = 19.7
     pylab.gca().set_aspect(1.0 / pylab.cos(pylab.pi / 180.0 * mean_lat))
开发者ID:rjleveque,项目名称:tsunami_benchmarks,代码行数:9,代码来源:setplot.py


示例8: createLines

		def createLines(pStrip,ySpecs,isY1=True,y2Exists=False):
			'''Create data lines from specifications; this code is common for y1 and y2 axes;
			it handles y-data specified as callables, which might create additional lines when updated with liveUpdate.
			'''
			# save the original specifications; they will be smuggled into the axes object
			# the live updated will run yNameFuncs to see if there are new lines to be added
			# and will add them if necessary
			yNameFuncs=set([d[0] for d in ySpecs if callable(d[0])]) | set([d[0].keys for d in ySpecs if hasattr(d[0],'keys')])
			yNames=set()
			ySpecs2=[]
			for ys in ySpecs:
				# ys[0]() must return list of strings, which are added to ySpecs2; line specifier is synthesized by tuplifyYAxis and cannot be specified by the user
				if callable(ys[0]): ySpecs2+=[(ret,ys[1]) for ret in ys[0]()]
				elif hasattr(ys[0],'keys'): ySpecs2+=[(yy,'') for yy in ys[0].keys()]
				else: ySpecs2.append(ys)
			if len(ySpecs2)==0:
				print 'yade.plot: creating fake plot, since there are no y-data yet'
				line,=pylab.plot([nan],[nan])
				line2,=pylab.plot([nan],[nan])
				currLineRefs.append(LineRef(line,None,line2,[nan],[nan]))
			# set different color series for y1 and y2 so that they are recognizable
			if pylab.rcParams.has_key('axes.color_cycle'): pylab.rcParams['axes.color_cycle']='b,g,r,c,m,y,k' if not isY1 else 'm,y,k,b,g,r,c'
			for d in ySpecs2:
				yNames.add(d)
				line,=pylab.plot(data[pStrip],data[d[0]],d[1],label=xlateLabel(d[0]))
				line2,=pylab.plot([],[],d[1],color=line.get_color(),alpha=afterCurrentAlpha)
				# use (0,0) if there are no data yet
				scatterPt=[0,0] if len(data[pStrip])==0 else (data[pStrip][current],data[d[0]][current])
				# if current value is NaN, use zero instead
				scatter=pylab.scatter(scatterPt[0] if not math.isnan(scatterPt[0]) else 0,scatterPt[1] if not math.isnan(scatterPt[1]) else 0,s=scatterSize,color=line.get_color(),**scatterMarkerKw)
				currLineRefs.append(LineRef(line,scatter,line2,data[pStrip],data[d[0]]))
			axes=line.get_axes()
			labelLoc=(legendLoc[0 if isY1 else 1] if y2Exists>0 else 'best')
			l=pylab.legend(loc=labelLoc)
			if hasattr(l,'draggable'): l.draggable(True)
			if scientific:
				pylab.ticklabel_format(style='sci',scilimits=(0,0),axis='both')
				# fixes scientific exponent placement for y2: https://sourceforge.net/mailarchive/forum.php?thread_name=20101223174750.GD28779%40ykcyc&forum_name=matplotlib-users
				if not isY1: axes.yaxis.set_offset_position('right')
			if isY1:
				pylab.ylabel((', '.join([xlateLabel(_p[0]) for _p in ySpecs2])) if p not in xylabels or not xylabels[p][1] else xylabels[p][1])
				pylab.xlabel(xlateLabel(pStrip) if (p not in xylabels or not xylabels[p][0]) else xylabels[p][0])
			else:
				pylab.ylabel((', '.join([xlateLabel(_p[0]) for _p in ySpecs2])) if (p not in xylabels or len(xylabels[p])<3 or not xylabels[p][2]) else xylabels[p][2])
			# if there are callable/dict ySpecs, save them inside the axes object, so that the live updater can use those
			if yNameFuncs:
				axes.yadeYNames,axes.yadeYFuncs,axes.yadeXName,axes.yadeLabelLoc=yNames,yNameFuncs,pStrip,labelLoc # prepend yade to avoid clashes
开发者ID:jakob-ifgt,项目名称:trunk,代码行数:47,代码来源:plot.py


示例9: test_verify_AIS

    def test_verify_AIS(self):
        model = iRBM(input_size=self.input_size,
                     hidden_size=self.hidden_size,
                     beta=self.beta)

        model.W.set_value(self.W)
        model.b.set_value(self.b)
        model.c.set_value(self.c)

        # Brute force
        print "Computing lnZ using brute force (i.e. summing the free energy of all posible $v$)..."
        V = theano.shared(value=cartesian([(0, 1)] * self.input_size, dtype=config.floatX))
        brute_force_lnZ = logsumexp(-model.free_energy(V), 0)
        f_brute_force_lnZ = theano.function([], brute_force_lnZ)

        params_bak = [param.get_value() for param in model.parameters]

        print "Approximating lnZ using AIS..."
        import time
        start = time.time()

        try:
            ais_working_dir = tempfile.mkdtemp()
            result = compute_AIS(model, M=self.nb_samples, betas=self.betas, seed=1234, ais_working_dir=ais_working_dir, force=True)
            logcummean_Z, logcumstd_Z_down, logcumstd_Z_up = result['logcummean_Z'], result['logcumstd_Z_down'], result['logcumstd_Z_up']
            std_lnZ = result['std_lnZ']

            print "{0} sec".format(time.time() - start)

            import pylab as plt
            plt.gca().set_xmargin(0.1)
            plt.errorbar(range(1, self.nb_samples+1), logcummean_Z, yerr=[std_lnZ, std_lnZ], fmt='or')
            plt.errorbar(range(1, self.nb_samples+1), logcummean_Z, yerr=[logcumstd_Z_down, logcumstd_Z_up], fmt='ob')
            plt.plot([1, self.nb_samples], [f_brute_force_lnZ()]*2, '--g')
            plt.ticklabel_format(useOffset=False, axis='y')
            plt.show()
            AIS_logZ = logcummean_Z[-1]

            assert_array_equal(params_bak[0], model.W.get_value())
            assert_array_equal(params_bak[1], model.b.get_value())
            assert_array_equal(params_bak[2], model.c.get_value())

            print np.abs(AIS_logZ - f_brute_force_lnZ())
            assert_almost_equal(AIS_logZ, f_brute_force_lnZ(), decimal=2)
        finally:
            shutil.rmtree(ais_working_dir)
开发者ID:MarcCote,项目名称:iRBM,代码行数:46,代码来源:test_irbm.py


示例10: plot_from_list

def plot_from_list( list_of_coordinates, fitfunction="nullfit", cubicspline=True, xticks=-1, yticks=-1 ):
   '''Plots the given list. The list should be in the following format:
      [[x1,y1], [x2,y2], [x3,y3], [x4,y4], .. ]
      :param list_of_coordinates    List of coordinates to be plotted
   '''
   index = 1
   fig = pl.figure()
   for i in list_of_coordinates:
      #title="(" + i[2] + "," + i[3] + ")"
      pl.subplot(len(list_of_coordinates), 1, index)
      #ax = fig.add_subplot(len(list_of_coordinates), 1, index)
      x = i[0]
      y = i[1]
      pl.xlabel(i[2])
      pl.ylabel(i[3])
      xlength = max(x) - min(x)
      ylength = max(y) - min(y)
      pl.xlim([min(x) - 0.01*xlength, max(x) + 0.01*xlength])
      pl.ylim([min(y) - 0.05*ylength, max(y) + 0.05*ylength])
      plot_variables(x,y,False,fitfunction,cubicspline=cubicspline)
      pl.ticklabel_format(style='sci', axis='y', scilimits=(-3,3))
      # Set y ticks
      if yticks > 0 and len(i) == 4:
         ticks = min(y) + np.arange(yticks + 1) / (float)(yticks)*ylength
         print len(i)
         from decimal import *
         getcontext().prec = 2
         # Get two decimals
         ticks = [float(Decimal(j)/Decimal(1)) for j in ticks]
         pl.yticks(ticks)
         print ticks
      # Set x ticks
      if xticks > 0 and len(i) == 4:
         ticks = min(x) + np.arange(xticks + 1) / (float)(xticks)*xlength
         from decimal import *
         getcontext().prec = 2
         # Get two decimals
         ticks = [float(Decimal(j)/Decimal(1)) for j in ticks]
         pl.xticks(ticks)
      index = index + 1
   #pl.tight_layout()
   pl.ion()
   pl.show()
开发者ID:fmihpc,项目名称:analysator,代码行数:43,代码来源:plots.py


示例11: plotDepth

def plotDepth():
    d = pd.read_pickle(utl.outpath + 'real/D.F59.df').replace({0: 1})

    z = pd.Series(np.ndarray.flatten(d.values))
    plt.figure(figsize=(8, 8), dpi=100);
    plt.subplot(2, 1, 1);
    sns.distplot(z, bins=180, norm_hist=False, kde=False);
    plt.xlim([0, 200]);
    plt.xlabel('Depth');
    plt.ylabel('Number of Measurments' + ' (out of {:.1f}M)'.format(z.shape[0] / 1e6));
    plt.ticklabel_format(axis='y', style='sci', scilimits=(0, 0))
    plt.subplot(2, 1, 2);
    sns.distplot(d.min(1), bins=50, norm_hist=False, kde=False);
    plt.xlim([0, 200]);
    plt.xlabel('Minimum Depth of each Site');
    plt.ylabel('Number of Sites' + ' (out of {:.1f}M)'.format(d.shape[0] / 1e6));

    plt.ticklabel_format(axis='y', style='sci', scilimits=(0, 0))
    plt.savefig(utl.paperFiguresPath + 'depth.pdf')
开发者ID:airanmehr,项目名称:bio,代码行数:19,代码来源:SamplingTimes.py


示例12: plotDepth

def plotDepth():
    sns.set_style("whitegrid", {"grid.color": "1", 'axes.linewidth': .5, "grid.linewidth": ".09"})
    sns.set_context("notebook", font_scale=1.4, rc={"lines.linewidth": 2.5})
    d = pd.read_pickle(utl.outpath + 'real/CD.F59.df').xs('D', level='READ', axis=1)
    (d.min(1) > 50).sum()

    (d > 50).sum().sum()

    z = pd.Series(np.ndarray.flatten(d.values))
    fontsize = 6
    mpl.rcParams.update({'font.size': fontsize})
    plt.figure(figsize=(6, 4), dpi=300);
    plt.subplot(2, 2, 1);
    z.value_counts().sort_index().plot()
    plt.xlim([0, 200]);
    plt.xlabel('Depth');
    plt.ylabel('Number of Measurments' + '\n (out of {:.1f}M)'.format(z.shape[0] / 1e6));
    plt.ticklabel_format(axis='y', style='sci', scilimits=(0, 0))
    plt.title('Scaled PDF')
    pplt.annotate('(A)', xpad=0.85, ypad=0.45, fontsize=fontsize)
    plt.axvline(50, linestyle='--', linewidth=1, color='k')
    pplt.setSize(plt.gca(), fontsize)
    plt.subplot(2, 2, 2);

    z.value_counts().sort_index().cumsum().plot()
    plt.xlim([0, 200])
    plt.ylim([-3e5, 2.05 * 1e7])
    plt.xlabel('Depth');
    plt.title('Scaled CDF')
    pplt.annotate('(B)', xpad=0.85, ypad=0.45, fontsize=fontsize)
    plt.axvline(50, linestyle='--', linewidth=1, color='k')
    pplt.setSize(plt.gca(), fontsize)
    plt.subplot(2, 2, 3);
    d.min(1).value_counts().sort_index().plot()
    plt.xlim([0, 100]);
    plt.xlabel('Minimum Depth of each Variant');
    plt.ylabel('Number of Variants' + '\n (out of {:.1f}M)'.format(d.shape[0] / 1e6));
    plt.ticklabel_format(axis='y', style='sci', scilimits=(0, 0))
    plt.rc('font', size=fontsize)
    pplt.annotate('(C)', xpad=0.85, ypad=0.45, fontsize=fontsize)
    plt.axvline(50, linestyle='--', linewidth=1, color='k')
    pplt.setSize(plt.gca(), fontsize)
    plt.subplot(2, 2, 4);
    d.min(1).value_counts().sort_index().cumsum().plot()
    plt.xlim([0, 60])
    plt.ylim([0.25 * -1e5, plt.ylim()[1]])
    plt.xlabel('Minimum Depth of each Variant');
    plt.ticklabel_format(axis='y', style='sci', scilimits=(0, 0))
    pplt.annotate('(D)', xpad=0.85, ypad=0.45, fontsize=fontsize)
    plt.axvline(50, linestyle='--', linewidth=1, color='k')
    pplt.setSize(plt.gca(), fontsize)
    plt.gcf().subplots_adjust(bottom=0.15)
    plt.gcf().tight_layout(h_pad=0.1)
    fontsize = 6
    mpl.rc('font', **{'family': 'serif', 'serif': ['Computer Modern'], 'size': fontsize});
    mpl.rc('text', usetex=True)
    mpl.rcParams.update({'font.size': 1})

    pplt.savefig('depth', 300)
    plt.show()
开发者ID:airanmehr,项目名称:bio,代码行数:60,代码来源:Depth.py


示例13: plotgaus

 def plotgaus(self,exp=None):
     """quickly plots the simulated gaussian isotope pattern"""
     import pylab as pl
     try:
         pl.plot(self.gausip[0],self.gausip[1],linewidth=1)
     except AttributeError:
         self.gausip = self.gaussianisotopepattern()
         pl.plot(self.gausip[0],self.gausip[1],linewidth=1)
     if exp is not None: # plots experimental if supplied
         y = []
         maxy = max(exp[1])
         for val in exp[1]: # normalize
             y.append(val/maxy*100)
         comp = self.compare(exp)
         pl.plot(exp[0],exp[1])
         pl.text(max(exp[0]),95,'SER: '+`comp`)
         #pl.fill_between(x,self.gausip[1],exp[1],where= exp[1] =< self.gausip[1],interpolate=True, facecolor='red')
     pl.fill(self.gausip[0],self.gausip[1],facecolor='blue',alpha=0.25)
     pl.xlabel('m/z', style='italic')
     pl.ylabel('normalized intensity')
     pl.ticklabel_format(useOffset=False)
     pl.show()
开发者ID:Yeungdb,项目名称:mass-spec-python-tools,代码行数:22,代码来源:_Molecule.py


示例14: P_AP

def P_AP(folder,keys):
  
  for f in folder:
    
    
    a=Analysis.AnalyseFile()
    a.add_column(f.column('Current'),'Current')
    a.add_column(f.column('Mean'),'NLV')
    
    fit, fitVar= a.curve_fit(quad,'Current','NLV',bounds=lambda x,y:abs(x)>200e-6,result=True,header='Fit') 
    
    plt.title(r'')
    plt.xlabel(r'Temperature (K)')
    plt.ylabel(r'$\beta$ (V/A$^2$)')
    plt.ticklabel_format(style='plain', scilimits=(3 ,3))
    plt.hold(True)
    
    '''
    if f['IVtemp'] == 5:
      plt.plot(a.column('Current'),a.column('NLV'),'b')
      plt.plot(a.column('Current'),a.column('Fit'),'k')
      
    '''
    print f['state'],f['IVtemp']
    
    if f['state'] == 'P':
      #plt.plot(f['IVtemp'],fit[0],'ro')
      print fitVar
      plt.errorbar(f['IVtemp'],fit[0],numpy.sqrt(fitVar[0,0]),ecolor='k',marker='o',mfc='red', mec='k',ms=15.0)
      print 'p'
    if f['state'] == 'AP':
      print 'ap'
      plt.errorbar(f['IVtemp'],fit[0],numpy.sqrt(fitVar[0,0]),ecolor='k',marker='o',mfc='blue', mec='k',ms=15.0)
      #plt.plot(f['IVtemp'],fit[0],'bx')
  #plt.legend()
  plt.savefig('/Users/Joe/PhD/Talks/MMM13/beta.eps', bbox_inches=0)
  plt.show()
开发者ID:joebatley,项目名称:PythonCode,代码行数:37,代码来源:NLIV_average_vsT_2groups.py


示例15: plot_stat_without_eq

def plot_stat_without_eq(dictionary, file, location=None):
	fig = pylab.figure()
	count = 0
	print(type(dictionary))
	lis = sorted(dictionary.keys())

	for key in lis:
		count+=1
		axes = dictionary.get(key)

		filename = str(file) + '.png'
		
		fig.add_subplot(4, 2, (count))
		pylab.ticklabel_format(style='sci', axis = 'both', scilimits=(0,0))
		pylab.plot(axes.get('x'), axes.get('y'), str(1), color='0.4', marker='o', markeredgecolor='0.4')
		pylab.xlabel('iTRAQAnalyzer')
		pylab.ylabel('Protein Pilot')
		pylab.rc('font', size=5.5)

		# z[0] denotes slope, z[1] denotes the intercept
		z = np.polyfit(axes.get('x'), axes.get('y'), 1)
		p = np.poly1d(z)
		coeff = np.corrcoef(axes.get('x'), axes.get('y'))

		pylab.plot(axes.get('x'), p(axes.get('x')), "r-", color='0')
		print "y=%.6fx+(%.6f)"%(z[0],z[1])
		# pylab.text(0.1, 0.3, "y=%.6fx+(%.6f)"%(z[0],z[1]))
		print str(coeff[0][1])
		pylab.title(str(key))
		pylab.tight_layout()

		graph = pylab.gcf()
		graph.canvas.set_window_title(str(filename))

	graph.savefig(location + '/' + filename)
	pylab.close()
开发者ID:PragyaJaiswal,项目名称:Benchmarking,代码行数:36,代码来源:load.py


示例16: range

AP = a.mean('Rs',bounds = lambda x: x<Ref)
DeltaR = P-AP

print DeltaR

Perr = (numpy.std(a.search('Rs',lambda x,y:x>Ref,'Rs')))/numpy.sqrt(len(a.search('Rs',lambda x,y:x>Ref,'Rs'))) # error in average value for P state
APerr = (numpy.std(a.search('Rs',lambda x,y:x<Ref,'Rs')))/numpy.sqrt(len(a.search('Rs',lambda x,y:x<Ref,'Rs')))
DeltaRerr = numpy.sqrt((Perr*Perr)+(APerr*APerr)) #calculate error in Delta R in micro Ohms

print DeltaRerr


plt.title()
plt.xlabel('B (T)')
plt.ylabel(r'R$_s$ ($\mu$V/A)')
plt.ticklabel_format(style = 'sci', useOffset = False)
plt.tick_params(axis='both', which='minor')
plt.plot(data.column('Field'),data.column('Rs (microOhms)'),'-ob')
#matplotlib.pyplot.grid(False)
#plt.show()

b=Analysis.AnalyseFile()

for f in folder:
    
    Rmax = numpy.max(f.column('Resistance'))
    Rmin = numpy.min(f.column('Resistance'))    
    offset = ((Rmax-Rmin)/2)+Rmin        
    
    for i in range(0,len(f.column('Res'))-1,1):
        if f.column('Resistance')[i]>offset and  f.column('Resistance')[i+1]<offset:                       
开发者ID:joebatley,项目名称:PythonCode,代码行数:31,代码来源:DeltaRvsH_switching_analysis.py


示例17: datetime

    dt = datetime(2000, 1, 1)
    lat = 0
    lon = 0

    iri_ne = []
    for alt_i in alt:
        point = Point(dt, lat, lon, alt_i)
        point.run_iri()
        iri_ne.append(point.ne)

    Nm_star, Hm_star, H_O_star = chapman_fit(alt, iri_ne, verbose=True)

    chapman_ne = [chapman(z, Nm_star, Hm_star, H_O_star) for z in alt]

    fig = PL.figure(figsize=(6,10))
    PL.plot(iri_ne,
            alt,
            color='b',
            label='IRI')
    PL.plot(chapman_ne,
            alt,
            color='g',
            label='Chapman fit')
    PL.legend()
    PL.xlabel('Electron density [cm$^{-3}$]')
    PL.ylabel('Height [km]')
    PL.ticklabel_format(style='sci', axis='x', scilimits=(0,0))
    PL.axis('tight')

    PL.show()
开发者ID:butala,项目名称:pyrsss,代码行数:30,代码来源:chapman.py


示例18: plot_mass_spectrum


#.........这里部分代码省略.........
                **font
            )

    if settings['spectype'] == 'continuum':
        ax.plot(
            realspec[0],
            realspec[1],
            linewidth=settings['lw'],
            color=Colour(settings['speccolour']).mpl
        )
    elif settings['spectype'] == 'centroid':
        dist = []
        for ind, val in enumerate(realspec[0]):  # find distance between all adjacent m/z values
            if ind == 0:
                continue
            dist.append(realspec[0][ind] - realspec[0][ind - 1])
        dist = sum(dist) / len(dist)  # average distance
        ax.bar(
            realspec[0],
            realspec[1],
            dist * 0.75,
            linewidth=0,
            color=Colour(settings['speccolour']).mpl,
            align='center',
            alpha=0.8
        )

    if settings['annotations'] is not None:
        for label in settings['annotations']:
            ax.text(
                settings['annotations'][label][0],
                settings['annotations'][label][1],
                label,
                horizontalalignment='center',
                **font
            )

            # show or hide axis values/labels as specified
    if settings['yvalues'] is False:  # y tick marks and values
        ax.tick_params(axis='y', labelleft='off', length=0)
    if settings['yvalues'] is True:  # y value labels
        ax.tick_params(
            axis='y',
            length=settings['axwidth'] * 3,
            width=settings['axwidth'],
            direction='out',
            right='off'
        )
        for label in ax.get_yticklabels():
            label.set_fontproperties(tickfont)
    if settings['ylabel'] is True:  # y unit
        if top == 100:  # normalized
            ax.set_ylabel('relative intensity', **font)
        else:  # set to counts
            ax.set_ylabel('intensity (counts)', **font)

    if settings['xvalues'] is False:  # x tick marks and values
        ax.tick_params(axis='x', labelbottom='off', length=0)
    if settings['xvalues'] is True:  # x value labels
        ax.tick_params(
            axis='x',
            length=settings['axwidth'] * 3,
            width=settings['axwidth'],
            direction='out',
            top='off'
        )
        for label in ax.get_xticklabels():
            label.set_fontproperties(tickfont)
    if settings['xlabel'] is True:  # x unit
        ax.set_xlabel('m/z', style='italic', **font)

    pl.ticklabel_format(useOffset=False)  # don't use the stupid shorthand thing
    if settings['padding'] == 'auto':
        pl.tight_layout(pad=0.5)  # adjust subplots
        if settings['simlabels'] is True or settings['stats'] is True or settings['delta'] is True:
            pl.subplots_adjust(top=0.90)  # lower top if details are called for
    elif type(settings['padding']) is list and len(settings['padding']) == 4:
        pl.subplots_adjust(
            left=settings['padding'][0],
            right=settings['padding'][1],
            bottom=settings['padding'][2],
            top=settings['padding'][3]
        )

    if settings['output'] == 'save':  # save figure
        outname = ''  # generate tag for filenaming
        for species in simdict:
            outname += ' ' + species
        outname = settings['outname'] + outname + '.' + settings['exten']
        pl.savefig(
            outname,
            dpi=settings['dpiout'],
            format=settings['exten'],
            transparent=True
        )
        if settings['verbose'] is True:
            sys.stdout.write('Saved figure as:\n"%s"\nin the working directory' % outname)

    elif settings['output'] == 'show':  # show figure
        pl.show()
开发者ID:larsyunker,项目名称:mass-spec-python-tools,代码行数:101,代码来源:tome.py


示例19: fixticks1

 def fixticks1(current_data):
     from pylab import ticklabel_format
     ticklabel_format(format='plain',useOffset=False)
开发者ID:cjvogl,项目名称:seismic,代码行数:3,代码来源:setplot.py


示例20: fixticks

 def fixticks(current_data):
     from pylab import ticklabel_format, plot
     ticklabel_format(format='plain',useOffset=False)
     if xmax is not None:
         plot(xmax, etamax, 'r')
开发者ID:cjvogl,项目名称:seismic,代码行数:5,代码来源:setplot.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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