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


Python LineCollection.remove方法代码示例

本文整理汇总了Python中matplotlib.collections.LineCollection.remove方法的典型用法代码示例。如果您正苦于以下问题:Python LineCollection.remove方法的具体用法?Python LineCollection.remove怎么用?Python LineCollection.remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在matplotlib.collections.LineCollection的用法示例。


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

示例1: plotLoop

# 需要导入模块: from matplotlib.collections import LineCollection [as 别名]
# 或者: from matplotlib.collections.LineCollection import remove [as 别名]
def plotLoop(myFiles,fbase,tlist,grid,plot,vmax,vwidth,d,dateStr):
	import datetime as dt
	#print args
	#myFiles,fbase,tlist,grid = args
	#create a pygrid item
	myGrid = pygrid()
	#create a MPL figure
	myFig = plt.figure()
	print tlist
	#draw a map
	myMap = drawPygridMap(myFig,myGrid,grid=grid)
	for ctime in tlist:
		
		myGrid.delVecs()
		print ctime
		print 'plotting'
		#read the files we have opened
		for f in myFiles:
			#print 'reading'
			#read a record
			print ctime
			readPygridRec(f,myGrid,datetimeToEpoch(ctime),-1)
			
		t1=dt.datetime.now()
		#get the vectors
		print 'drawing'
		
		circs,lines,intensities = drawPygridVecs(myGrid,myMap,plot=plot,vmax=vmax)

		#add the collection of vectors to the figure
		ccoll = plt.scatter(circs[0],circs[1],s=.5,c='k')
		lcoll = LineCollection(numpy.array(lines),linewidths=vwidth,zorder=10)
		lcoll.set_array(numpy.array(intensities))
		myFig.gca().add_collection(lcoll)
		
		#do the colormapping
		pydarn.plot.plotUtils.genCmap(myMap,lcoll,'grid',[0,vmax],colors='aj',map=1)
		
		txt = plt.figtext(.5,.95,ctime.strftime("%Y/%m/%d  %H:%M:%S"),weight=550,size='large',ha='center')
		t2 = dt.datetime.now()
		myFig.savefig(d+'/'+str(int(datetimeToEpoch(ctime)))+'.'+fbase+'.'+plot+'.svg', bbox_inches=0)
		t3 = dt.datetime.now()
		print 'drawing took', t2-t1
		print 'saving took',t3-t2
		ccoll.remove()
		lcoll.remove()
		myFig.texts.remove(txt)
开发者ID:alexmorrisak,项目名称:davitpy,代码行数:49,代码来源:pygridPlot.py


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