本文整理汇总了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)