當前位置: 首頁>>代碼示例>>Python>>正文


Python Plotter.show方法代碼示例

本文整理匯總了Python中Plotter.Plotter.show方法的典型用法代碼示例。如果您正苦於以下問題:Python Plotter.show方法的具體用法?Python Plotter.show怎麽用?Python Plotter.show使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Plotter.Plotter的用法示例。


在下文中一共展示了Plotter.show方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1:

# 需要導入模塊: from Plotter import Plotter [as 別名]
# 或者: from Plotter.Plotter import show [as 別名]
      0,
      1.0/(2**0.5)
    ]

d = [ +1,
      -1,
      +1,
      -1,
      +1,
      -1,
      +1,
      -1
    ]

e = [ +1,
      +1,
      +1,
      +1,
      -1,
      -1,
      -1,
      -1
    ]

N = 8
for i in [(a, 'a'), (b, 'b'), (c, 'c'), (d, 'd'), (e, 'e')]:
    func = i[0]
    name = i[1]
    Plotter.plotRealAndImaginary( DFT.dft(func, N), N, "problem 2: part "+name)
    Plotter.show()
開發者ID:JRJurman,項目名稱:vision-stuff,代碼行數:32,代碼來源:problem2.py

示例2: Plotter

# 需要導入模塊: from Plotter import Plotter [as 別名]
# 或者: from Plotter.Plotter import show [as 別名]
if __name__ == '__main__':

	# Init the plotter with some axis parameters
	plotter = Plotter([-20, 80], [-20, 80])

	# Load data
	# TODO Try loading the smallDataSet.txt and see what happens.
	# Try not to use the large data sets since the program will be quite slow
	# If you want a different dataset talk to @Johan
	trainingX, trainingY = loadData('testData.txt')

	print "Init - show the data..."
	# Just show the data
	plotter.plotUnlabledData(trainingX, trainingY)
	plotter.show()
	raw_input('Press enter to continue')

	# Define the centroids based on some points
	print "Init - Create the first cluster points and plot them..."
	# TODO here is where you change the number of centroids by adding or removing the points.
	# The numbers represent the starting points of each centroid with the following coordinate pair: (x, y)
	clusterPoints = [Point(2, 3), Point(35, 20), Point(40, 40), Point(60, 60), Point(30, 30)]
	centroids = getCentroids(clusterPoints) # just convert the points to centroids for plotting and labeling assistance...
	plotter.plotCentroids(centroids)
	print "Init complete..."
	raw_input('Press enter to continue and to start the algorithm.')

	# Run the algorith 10 times
	# TODO So right now we are running the algorithm 10 times. Maybe we should come up with some better meassurement?
	for x in xrange(1,10):
開發者ID:r2m,項目名稱:machine-learning,代碼行數:32,代碼來源:main.py


注:本文中的Plotter.Plotter.show方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。