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


Python pagesizes.landscape方法代碼示例

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


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

示例1: gen_decomposition

# 需要導入模塊: from reportlab.lib import pagesizes [as 別名]
# 或者: from reportlab.lib.pagesizes import landscape [as 別名]
def gen_decomposition(denovo_name, basis_names, weights, output_path, project, reconstruction, statistics):

	c = canvas.Canvas(output_path+"/"+denovo_name+"_decomposition_"+project+".pdf", pagesize=letter)
	c.setPageSize(landscape(letter))
	c.setFont("Arial-Bold", 7.19)

	basis_plots = []
	for i in range(0,len(basis_names)):
		basis_plots.append([basis_names[i], weights[i]])


	# create for loop to iterate through list, then change second value in list of lists
	# Otherwise sorts strings and then 5.14% > 48.54%
	for j in range(0, len(basis_names)):
		basis_plots[j][1] = float(basis_plots[j][1].strip("%"))
	sorted_list = sorted(basis_plots, key=lambda tup: tup[1], reverse=True)

	gen_plot(denovo_name, sorted_list, output_path, project, c, reconstruction, statistics)

	c.save() 
開發者ID:AlexandrovLab,項目名稱:SigProfilerExtractor,代碼行數:22,代碼來源:PlotDecomposition_SBS96.py

示例2: gen_decomposition

# 需要導入模塊: from reportlab.lib import pagesizes [as 別名]
# 或者: from reportlab.lib.pagesizes import landscape [as 別名]
def gen_decomposition(denovo_name, basis_names, weights, output_path, project, reconstruction, statistics):
	# Note: 0th index contains the title of the column
	c = canvas.Canvas(output_path+"/"+denovo_name+"_decomposition_"+project+".pdf", pagesize=letter)
	c.setPageSize(landscape(letter))
	c.setFont("Arial-Bold", 7.19)

	basis_plots = []
	for i in range(0,len(basis_names)):
		basis_plots.append([basis_names[i], weights[i]])


	# create for loop to iterate through list, then change second value in list of lists
	# Otherwise sorts strings and then 5.14% > 48.54%
	for j in range(0, len(basis_names)):
		basis_plots[j][1] = float(basis_plots[j][1].strip("%"))
	sorted_list = sorted(basis_plots, key=lambda tup: tup[1], reverse=True)

	gen_plot(denovo_name, sorted_list, output_path, project, c, reconstruction, statistics)

	c.save() 
開發者ID:AlexandrovLab,項目名稱:SigProfilerExtractor,代碼行數:22,代碼來源:PlotDecomposition_ID83.py

示例3: gen_decomposition

# 需要導入模塊: from reportlab.lib import pagesizes [as 別名]
# 或者: from reportlab.lib.pagesizes import landscape [as 別名]
def gen_decomposition(denovo_name, basis_names, weights, output_path, project, reconstruction, statistics):
	# Note: 0th index contains the title of the column
	c = canvas.Canvas(output_path+"/"+denovo_name+"_decomposition_"+project+".pdf", pagesize=letter)
	c.setPageSize(landscape(letter))
	c.setFont("Arial-Bold", 7.19)

	basis_plots = []
	for i in range(0,len(basis_names)):
		basis_plots.append([basis_names[i], weights[i]])

	# create for loop to iterate through list, then change second value in list of lists
	# Otherwise sorts strings and then 5.14% > 48.54%
	for j in range(0, len(basis_names)):
		basis_plots[j][1] = float(basis_plots[j][1].strip("%"))
	sorted_list = sorted(basis_plots, key=lambda tup: tup[1], reverse=True)

	gen_plot(denovo_name, sorted_list, output_path, project, c, reconstruction, statistics)

	c.save() 
開發者ID:AlexandrovLab,項目名稱:SigProfilerExtractor,代碼行數:21,代碼來源:PlotDecomposition_SBS1536.py

示例4: build_doc

# 需要導入模塊: from reportlab.lib import pagesizes [as 別名]
# 或者: from reportlab.lib.pagesizes import landscape [as 別名]
def build_doc(cls, path, pagesize=None, showBoundary=1, allowSplitting=1, **dargs):
        if pagesize is None:
            pagesize = landscape(letter)
        return BaseDocTemplate(path, pagesize=pagesize, showBoundary=showBoundary, allowSplitting=allowSplitting,
                               **dargs) 
開發者ID:bpsmith,項目名稱:tia,代碼行數:7,代碼來源:builder.py


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