本文整理汇总了Python中matplotlib.figure.Figure.subplotpars方法的典型用法代码示例。如果您正苦于以下问题:Python Figure.subplotpars方法的具体用法?Python Figure.subplotpars怎么用?Python Figure.subplotpars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.figure.Figure
的用法示例。
在下文中一共展示了Figure.subplotpars方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: bgPlot
# 需要导入模块: from matplotlib.figure import Figure [as 别名]
# 或者: from matplotlib.figure.Figure import subplotpars [as 别名]
def bgPlot( data,iT,black, tStep, bgHist, titleS=None ):
if black:
if tStep == arguments.animate[0]:
txtc = 'w'
else:
txtc = 'gray'
face = 'k'
cmap = cm.bone
else:
if tStep == arguments.animate[0]:
txtc = 'k'
else:
txtc = 'gray'
face = 'w'
cmap = cm.binary
fig = Figure( figsize=(6.4,4.8) )
fig.subplotpars = SubplotParams(left=.10,right=.95,bottom=.125,top=.80)
gs = gridspec.GridSpec(2, 2)
if titleS:
titleS += '\n%4.3f'%iT
else:
titleS = '%4.3f'%iT
if titleS:
fig.text(0.5,.95, titleS, color=txtc,
horizontalalignment='center',
verticalalignment='top',)
nbins = arguments.nbins
#the primary plot, Az vs El
mask = data.time < iT
if arguments.cos:
#the range rings
theta = linspace(0,2*pi,1000)
circX = sin(theta)
circY = cos(theta)
aeHist = histogram2d( data.cosa[mask],
data.cosb[mask],
weights=data.pkpk[mask],
bins=[nbins*2,nbins*2],
range=[data.caRange,data.cbRange] )
#scale the histogram
aeHist[0][:] -= aeHist[0].min()
if aeHist[0].max() > 0:
aeHist[0][:] = (aeHist[0]/aeHist[0].max())**0.3
else:
aeHist = histogram2d( data.elev[mask],
data.azim[mask],
weights=data.pkpk[mask],
bins=[nbins*2,nbins*2],
range=[data.elRange,data.azRange] )
#scale the histogram
aeHist[0][:] -= aeHist[0].min()
if aeHist[0].max() > 0:
aeHist[0][:] = (aeHist[0]/aeHist[0].max())**0.3
ax1 = fig.add_subplot(gs[:,0],axisbg=face)
if arguments.cos:
ax1.plot(circX,circY,c=txtc,ls='-')
ax1.plot(circX*cos(30*pi/180),circY*cos(30*pi/180),c=txtc,ls=':')
ax1.plot(circX*cos(60*pi/180),circY*cos(60*pi/180),c=txtc,ls=':')
ax1.pcolormesh( aeHist[2], aeHist[1], aeHist[0], cmap=cmap)
ax1.yaxis.set_tick_params(labelcolor=txtc)
ax1.yaxis.set_tick_params(color=txtc)
ax1.xaxis.set_tick_params(labelcolor=txtc)
ax1.xaxis.set_tick_params(color=txtc)
if arguments.cos:
ax1.set_xlim( data.cbRange )
ax1.set_ylim( data.caRange )
ax1.set_aspect('equal')
if arguments.fancy:
ax1.set_ylabel('$\\cos(\\beta)$', color=txtc)
ax1.set_xlabel('$\\cos(\\alpha)$', color=txtc)
else:
ax1.set_ylabel('cos(beta)', color=txtc)
ax1.set_xlabel('cos(alpha)', color=txtc)
else:
ax1.set_xlim( data.azRange )
ax1.set_ylim( data.elRange )
ax1.set_xlabel('Azimuth', color=txtc)
ax1.set_ylabel('Elevation', color=txtc)
ax1.locator_params(axis='x',nbins=6)
#time axis 1
#etHist = histogram2d( data[:,2],data[:,0],weights=data[:,4]**2, bins=[nbins/2,nbins], range=[elRange,tRange] )
#scale the histogram
#etHist[0][:] -= etHist[0].min()
#etHist[0][:] = (etHist[0]/etHist[0].max())**(arguments.alphaEx/2)
ax2 = fig.add_subplot(gs[0,1],axisbg=face)
#ax2.pcolormesh( etHist[2], etHist[1], etHist[0], cmap=cmap)
ax2.pcolormesh( bgHist[0][2], bgHist[0][1], bgHist[0][0], edgecolor='None',cmap=cmap)
ax2.vlines( iT, 0, 90, 'r' )
ax2.yaxis.set_tick_params(labelcolor=txtc)
ax2.yaxis.set_tick_params(color=txtc)
ax2.xaxis.set_tick_params(labelcolor=txtc)
ax2.xaxis.set_tick_params(color=txtc)
ax2.set_xlim( data.tRange )
#.........这里部分代码省略.........
示例2: bgPlot_notime
# 需要导入模块: from matplotlib.figure import Figure [as 别名]
# 或者: from matplotlib.figure.Figure import subplotpars [as 别名]
def bgPlot_notime(data,iT,black, tStep, bgHist, titleS=None ):
if black:
if tStep == arguments.animate[0]:
txtc = 'w'
else:
txtc = 'gray'
face = 'k'
cmap = cm.bone
else:
if tStep == arguments.animate[0]:
txtc = 'k'
else:
txtc = 'gray'
face = 'w'
cmap = cm.binary
fig = Figure( figsize=(6.4,4.8) )
fig.subplotpars = SubplotParams(left=.10,right=.95,bottom=.125,top=.80)
gs = gridspec.GridSpec(2, 2)
if titleS:
titleS += '\n%4.3f'%iT
else:
titleS = '%4.3f'%iT
fig.text(0.5,.95, titleS, color=txtc,
horizontalalignment='center',
verticalalignment='top',)
nbins = arguments.nbins
#the primary plot, Az vs El
mask = data.time < iT
if arguments.cos:
#the range rings
theta = linspace(0,2*pi,1000)
circX = sin(theta)
circY = cos(theta)
aeHist = histogram2d( data.cosa[mask],
data.cosb[mask],
weights=data.pkpk[mask],
bins=[nbins*2,nbins*2],
range=[data.caRange,data.cbRange] )
#scale the histogram
#aeHist[0][:] -= aeHist[0].min()
aeHist[0][:] = (aeHist[0]/aeHistMax)**.3
else:
aeHist = histogram2d( data.elev[mask],
data.azim[mask],
weights=data.pkpk[mask],
bins=[nbins*2,nbins*2],
range=[data.elRange,data.azRange] )
#scale the histogram
#aeHist[0][:] -= aeHist[0].min()
aeHist[0][:] = (aeHist[0]/aeHistMax)**.3
ax1 = fig.add_subplot(111,axisbg=face, aspect='equal')
if arguments.cos:
ax1.plot(circX,circY,c=txtc,ls='-')
ax1.plot(circX*cos(30*pi/180),circY*cos(30*pi/180),c=txtc,ls=':')
ax1.plot(circX*cos(60*pi/180),circY*cos(60*pi/180),c=txtc,ls=':')
ax1.pcolormesh( aeHist[2], aeHist[1], aeHist[0], cmap=cmap, vmax=1, vmin=0)
ax1.yaxis.set_tick_params(labelcolor=txtc)
ax1.yaxis.set_tick_params(color=txtc)
ax1.xaxis.set_tick_params(labelcolor=txtc)
ax1.xaxis.set_tick_params(color=txtc)
if arguments.cos:
ax1.set_xlim( data.cbRange )
ax1.set_ylim( data.caRange )
ax1.set_aspect('equal')
if arguments.fancy:
ax1.set_ylabel('$\\cos(\\beta)$', color=txtc)
ax1.set_xlabel('$\\cos(\\alpha)$', color=txtc)
else:
ax1.set_ylabel('cos(beta)', color=txtc)
ax1.set_xlabel('cos(alpha)', color=txtc)
else:
ax1.set_xlim( data.azRange )
ax1.set_ylim( data.elRange )
ax1.set_xlabel('Azimuth', color=txtc)
ax1.set_ylabel('Elevation', color=txtc)
ax1.locator_params(axis='x',nbins=6)
return fig, [ax1]