Python reportlab.lib.pagesizes.landscape() Examples

The following are 8 code examples of reportlab.lib.pagesizes.landscape(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module reportlab.lib.pagesizes , or try the search function .
Example #1
Source File: PlotDecomposition_SBS96.py    From SigProfilerExtractor with BSD 2-Clause "Simplified" License 6 votes vote down vote up
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() 
Example #2
Source File: PlotDecomposition_ID83.py    From SigProfilerExtractor with BSD 2-Clause "Simplified" License 6 votes vote down vote up
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() 
Example #3
Source File: PlotDecomposition_DBS78.py    From SigProfilerExtractor with BSD 2-Clause "Simplified" License 6 votes vote down vote up
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() 
Example #4
Source File: PlotDecomposition_SBS1536.py    From SigProfilerExtractor with BSD 2-Clause "Simplified" License 6 votes vote down vote up
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() 
Example #5
Source File: PlotDecomposition_SBS96.py    From SigProfilerExtractor with BSD 2-Clause "Simplified" License 6 votes vote down vote up
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() 
Example #6
Source File: PlotDecomposition_DBS78.py    From SigProfilerExtractor with BSD 2-Clause "Simplified" License 6 votes vote down vote up
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() 
Example #7
Source File: PlotDecomposition_SBS1536.py    From SigProfilerExtractor with BSD 2-Clause "Simplified" License 6 votes vote down vote up
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() 
Example #8
Source File: builder.py    From tia with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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)