本文整理匯總了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()
示例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()
示例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()
示例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)