python reportlab

python 使用reportlab打造29页图文并茂pdf(全网reportlab最强pdf自动化生成代码) 这次项目所使用的代码如果同志们可以灵活使用,基本上可以解决百分之九十以上的pdf模板自动化生成。最近博主,做了一个项目,使用reportlab制作pdf,博主打算把代码分享出来,先看一下博主生成的pdf:以上就是,这次项目生成的pdf,使用的数据,我就不分享了,下面是代码。 阅读详情

颜色

PDF中常用的颜色有两个类型:

  1. RGB:常用于屏幕显示
  2. CMYK:常用于专业的印刷场景

RGB颜色

RGB即红(red),绿(green)和蓝(blue)。用这三种颜色的参数形成各种不同的颜色,比如 (1,1,1) 就代表白色。
在pdfgen中有3中方法可以生成颜色:

  1. 使用color模块
  2. 使用RGB值
  3. 使用灰度
    下面的例子展示了这些方法:
from reportlab.pdfgen import canvas

def colorsRGB(canvas):
    from reportlab.lib import colors
    from reportlab.lib.units import inch
	# 使用color模块生成颜色
    black = colors.black
    y = x = 0; dy=inch*3/4.0; dx=inch*5.5/5; w=h=dy/2; rdx=(dx-w)/2
    rdy=h/5.0; texty=h+2*rdy
    canvas.setFont("Helvetica",10)
    for [namedcolor, name] in (
			[colors.lavenderblush, "lavenderblush"],
			[colors.lawngreen, "lawngreen"],
			[colors.lemonchiffon, "lemonchiffon"],
			[colors.lightblue, "lightblue"],
			[colors.lightcoral, "lightcoral"]):
        canvas.setFillColor(namedcolor)
        canvas.rect(x+rdx, y+rdy, w, h, fill=1)
        canvas.setFillColor(black)
        canvas.drawCentredString(x+dx/2, y+texty, name)
        x = x+dx
    y = y + dy; x = 0
	# 使用RGB值生成颜色
    for rgb in [(1,0,0), (0,1,0), (0,0,1), (0.5,0.3,0.1), (0.4,0.5,0.3)]:
        r,g,b = rgb
        canvas.setFillColorRGB(r,g,b)
        canvas.rect(x+rdx, y+rdy, w, h, fill=1)
        canvas.setFillColor(black)
        canvas.drawCentredString(x+dx/2, y+texty, "r%s g%s b%s"%rgb)
        x = x+dx
    y = y + dy; x = 0
 	# 使用灰度生成颜色
    for gray in (0.0, 0.25, 0.50, 0.75, 1.0):
        canvas.setFillGray(gray)
        canvas.rect(x+rdx, y+rdy, w, h, fill=1)
        canvas.setFillColor(black)
        canvas.drawCentredString(x+dx/2, y+texty, "gray: %s"%gray)
        x = x+dx
        
c= canvas.Canvas("colorsRGB.pdf")
colorsRGB(c)
c.showPage()
c.save()

效果如下:
RGB颜色

RGB颜色透明度

在pdfgen中有两种方式设置颜色透明度:

  1. 在CMYK中可以使用overPrint,这在之后会详细介绍。
  2. 在RGB中可以通过调节α参数来设置透明度,默认的α值是1,即完全不透明,其取值范围为[0,1]。
    两种方法的效果类似。下面是调节α参数的例子:
from reportlab.pdfgen import canvas

def alpha(canvas):
	from reportlab.lib.colors import Color, black, blue, red
	#透明度为50%的红色
	red50transparent = Color( 100, 0, 0, alpha=0.5)
	c = canvas 
	c.setFillColor(black)
	c.setFont('Helvetica', 10)
	c.drawString(25,180, 'solid')
	c.setFillColor(blue)
	c.rect(25,25,100,100, fill=True, stroke=False)
	c.setFillColor(red)
	c.rect(100,75,100,100, fill=True, stroke=False)
	c.setFillColor(black)
	c.drawString(225,180, 'transparent')
	c.setFillColor(blue)
	c.rect(225,25,100,100, fill=True, stroke=False)
	c.setFillColor(red50transparent)
	c.rect(300,75,100,100, fill=True, stroke=False)
        
c= canvas.Canvas("alpha.pdf")
alpha(c)
c.showPage()
c.save()

效果如下图:
颜色透明度

CMYK颜色

CMYK(印刷四色模式)是四种标准颜色混合叠加形成各种印刷颜色的模式。四种标准颜色是:C:Cyan = 青色,又称为‘天蓝色’或是‘湛蓝’;M:Magenta = 品红色,又称为‘洋红色’;Y:Yellow = 黄色;K:blacK=黑色。生成CMYK中各种颜色的值可以用[0,1](真值)表示,也可以用[0,100](整值)表示。0表示没有颜料,即白色;1或100表示某种颜色的最大值。下面是使用CMYK颜色的例子:

from reportlab.pdfgen import canvas

def colorsCMYK(canvas):
	from reportlab.lib.colors import CMYKColor
	from reportlab.lib.units import inch
	# 使用CMYK真值生成黑色
	black = CMYKColor(0,0,0,1)
	# 使用CMYK整值生成青色
	# cyan = PCMYKColor(100,0,0,0)
	y = x = 0; dy=inch*3/4.0; dx=inch*5.5/5; w=h=dy/2; rdx=(dx-w)/2
	rdy=h/5.0; texty=h+2*rdy
	canvas.setFont("Helvetica",10)
	y = y + dy; x = 0
	# 分别生成青色、品红色、黄色、黑色和白色
	for cmyk in [(1,0,0,0), (0,1,0,0), (0,0,1,0), (0,0,0,1), (0,0,0,0)]:
		c,m,y1,k = cmyk
		canvas.setFillColorCMYK(c,m,y1,k)
		canvas.rect(x+rdx, y+rdy, w, h, fill=1)
		canvas.setFillColor(black)
		canvas.drawCentredString(x+dx/2, y+texty, "c%s m%s y%s k%s"%cmyk)
		x = x+dx
        
c= canvas.Canvas("colorsCMYK.pdf")
colorsCMYK(c)
c.showPage()
c.save()

效果如下:
CMYK颜色模型

颜色overPrint

在CMYK中如果两种颜色重叠,就不能像RGB中那样使用α值来调节透明度了,只能使用overPrint,使重叠的部分的颜色混合。注意overprint的效果要用Adobe Acrobat Reader才能看得出来,其他pdf软件看不出混合效果。

使用白色形成在色块上抠字的效果

from reportlab.pdfgen import canvas

def spumoni(canvas):
	from reportlab.lib.units import inch
	from reportlab.lib.colors import pink, green, brown, white
	x = 0; dx = 0.4*inch
	# 生成底层色块
	for i in range(4):
		for color in (pink, green, brown):
			canvas.setFillColor(color)
			canvas.rect(x,0,dx,3*inch,stroke=0,fill=1)
			x = x+dx
	# 在色块上绘制白色的文字
	canvas.setFillColor(white)
	canvas.setStrokeColor(white)
	canvas.setFont("Helvetica-Bold", 85)
	canvas.drawCentredString(2.75*inch, 1.3*inch, "SPUMONI")
        
c= canvas.Canvas("spumoni.pdf")
spumoni(c)
c.showPage()
c.save()

效果如下图:
色块抠字
最后一个字母没有显示,是因为它已经在色块外面,和白色的页面融为一体了。
这个例子主要说明,在绘制有颜色的对象的时候要注意图层的先后顺序,后绘制的会覆盖先绘制的。

标准字体和文本对象

setFont函数可以设置字体和字号,setFillColor函数可以为文字添加颜色。例子如下:

from reportlab.pdfgen import canvas

def textsize(canvas):
    from reportlab.lib.units import inch
    from reportlab.lib.colors import magenta, red
	# 设置字体和字号
    canvas.setFont("Times-Roman", 20)
	# 设置颜色
    canvas.setFillColor(red)
    canvas.drawCentredString(2.75*inch, 2.5*inch, "Font size examples")
    canvas.setFillColor(magenta)
    size = 7
    y = 2.3*inch
    x = 1.3*inch
    lyrics = ['well she hit Net Solutions',
              'and she registered her own .com site now',
              'and filled it up with yahoo profile pics',
              'she snarged in one night now',
              'and she made 50 million when HUgh Hefner',
              'boutght up the rights now',
              'and she\'ll have fun fun fun',
              'til her Daddy takes the keyboard away']
    for line in lyrics:
        canvas.setFont("Helvetica", size)
        canvas.drawRightString(x,y,"%s points: " % size)
        canvas.drawString(x,y, line)
        y = y-size*1.2
        size = size+1.5
        
c= canvas.Canvas("textsize.pdf")
textsize(c)
c.showPage()
c.save()

效果如下:
字体大小和颜色
下面这个例子展现不同的字体效果:

from reportlab.pdfgen import canvas

def fonts(canvas):
	from reportlab.lib.units import inch
	text = "Now is the time for all good men to..."
	x = 1.8*inch
	y = 2.7*inch
	# 获取所有内置字体
	for font in canvas.getAvailableFonts():
		canvas.setFont(font, 10)
		canvas.drawString(x,y,text)
		canvas.setFont("Helvetica", 10)
		canvas.drawRightString(x-10,y, font+":")
		y = y-13
        
c= canvas.Canvas("fonts.pdf")
fonts(c)
c.showPage()
c.save()

运行结果如下:
所有内置字体
其中Symbol和ZapfDingbats因为不能显示正常的文字,所以在这里显示不出来,它们只能显示特定的符号。

文本对象工具

使用drawString生成文本时最快的,除此之外还有很多设置文本对象的工具。pdfgen中的文本对象都包括一个游标,代表文本绘制或更改的位置,这个游标可以在文本行中移动。
**注意:**每次绘制文本,都必须以canvas.beginText()开始,并以canvas.drawText()结束。
下面举一个绘制文本的例子:

from reportlab.pdfgen import canvas

def cursormoves2(canvas):
	from reportlab.lib.units import inch
	# 开始绘制文本指令
	textobject = canvas.beginText()
	# 设置游标起始位置
	textobject.setTextOrigin(2, 2.5*inch)
	textobject.setFont("Helvetica-Oblique", 14)
	lyrics = ['well she hit Net Solutions',
              'and she registered her own .com site now',
              'and filled it up with yahoo profile pics',
              'she snarged in one night now',
              'and she made 50 million when HUgh Hefner',
              'boutght up the rights now',
              'and she\'ll have fun fun fun',
              'til her Daddy takes the keyboard away']
	for line in lyrics:
		# 绘制单行文本但不换行
		textobject.textOut(line)
		# 移动游标,注意y轴的正数代表下移点数
		textobject.moveCursor(14,14) 
	textobject.setFillColorRGB(0.4,0,1)
	# 绘制多行文本
	textobject.textLines('''
	With many apologies to the Beach Boys
	and anyone else who finds this objectionable
	''')
	# 结束绘制文本指令
	canvas.drawText(textobject)
        
c= canvas.Canvas("cursormoves2.pdf")
cursormoves2(c)
c.showPage()
c.save()

运行效果如下:
文本绘制
循环中,游标每次下移一个字号单位,并且右移一个字号单位。
pdfgen中的文本对象工具总结如下:

# 设置游标起始位置
textobject.setTextOrigin(x,y)
textobject.setTextTransform(a,b,c,d,e,f)
# 移动游标
textobject.moveCursor(dx, dy)
(x,y) = textobject.getCursor()
x = textobject.getX(); y = textobject.getY()
textobject.setFont(psfontname, size, leading = None)
# 绘制单行文本,但不换行
textobject.textOut(text)
# 绘制单行文本,并且换行
textobject.textLine(text='')
# 绘制多行文本
textobject.textLines(stuff, trim=1)

注意:textOut和textLine的区别。使用textLine的时候不需要移动游标来实现换行。

字符间距

setCharSpace可以调整单个字符间的间距。且看下例:

from reportlab.pdfgen import canvas

def charspace(canvas):
	from reportlab.lib.units import inch
	textobject = canvas.beginText()
	textobject.setTextOrigin(3, 2.5*inch)
	textobject.setFont("Helvetica-Oblique", 10)
	# 设置字距大小
	charspace = 0
	lyrics = ['well she hit Net Solutions',
              'and she registered her own .com site now',
              'and filled it up with yahoo profile pics',
              'she snarged in one night now',
              'and she made 50 million when HUgh Hefner',
              'boutght up the rights now',
              'and she\'ll have fun fun fun',
              'til her Daddy takes the keyboard away']
	for line in lyrics:
		# 应用间距
		textobject.setCharSpace(charspace)
		textobject.textLine("%s: %s" %(charspace,line))
		# 该表间距
		charspace = charspace+0.5
	textobject.setFillGray(0.4)
	textobject.textLines('''
	With many apologies to the Beach Boys
	and anyone else who finds this objectionable
	''')
	canvas.drawText(textobject)
        
c= canvas.Canvas("charspace.pdf")
charspace(c)
c.showPage()
c.save()

效果如下:
字体间距

单词间距

setWordSpace可以调整单词间的间距。且看下例:

from reportlab.pdfgen import canvas

def wordspace(canvas):
    from reportlab.lib.units import inch
    textobject = canvas.beginText()
    textobject.setTextOrigin(3, 2.5*inch)
    textobject.setFont("Helvetica-Oblique", 12)
	# 设置词距大小
    wordspace = 0
    lyrics = ['well she hit Net Solutions',
              'and she registered her own .com site now',
              'and filled it up with yahoo profile pics',
              'she snarged in one night now',
              'and she made 50 million when HUgh Hefner',
              'boutght up the rights now',
              'and she\'ll have fun fun fun',
              'til her Daddy takes the keyboard away']
    for line in lyrics:
		# 应用词距
        textobject.setWordSpace(wordspace)
        textobject.textLine("%s: %s" %(wordspace,line))
		# 改变词距
        wordspace = wordspace+2.5
    textobject.setFillColorCMYK(0.4,0,0.4,0.2)
    textobject.textLines('''
    With many apologies to the Beach Boys
    and anyone else who finds this objectionable
    ''')
    canvas.drawText(textobject)
        
c= canvas.Canvas("wordspace.pdf")
wordspace(c)
c.showPage()
c.save()

效果如下:
字体词距

水平比例

setHorizScale可以调整文本行的伸缩比例。且看下例:

from reportlab.pdfgen import canvas

def horizontalscale(canvas):
	from reportlab.lib.units import inch
	textobject = canvas.beginText()
	textobject.setTextOrigin(3, 2.5*inch)
	textobject.setFont("Helvetica-Oblique", 12)
	# 设置伸缩比例,默认值是100
	horizontalscale = 80
	lyrics = ['well she hit Net Solutions',
             'and she registered her own .com site now',
             'and filled it up with yahoo profile pics',
             'she snarged in one night now',
             'and she made 50 million when HUgh Hefner',
             'boutght up the rights now',
             'and she\'ll have fun fun fun',
             'til her Daddy takes the keyboard away']
	for line in lyrics:
		# 应用伸缩比例
		textobject.setHorizScale(horizontalscale)
		textobject.textLine("%s: %s" %(horizontalscale,line))
		# 改变伸缩比例
		horizontalscale = horizontalscale+10
	textobject.setFillColorCMYK(0.0,0.4,0.4,0.2)
	textobject.textLines('''
	With many apologies to the Beach Boys
	and anyone else who finds this objectionable	
	''')
	canvas.drawText(textobject)
        
c= canvas.Canvas("horizontalscale.pdf")
horizontalscale(c)
c.showPage()
c.save()

效果如下:
文本行伸缩

行距

setLeading可以调整文本行距。且看下例:

from reportlab.pdfgen import canvas

def leading(canvas):
	from reportlab.lib.units import inch
	textobject = canvas.beginText()
	textobject.setTextOrigin(3, 2.5*inch)
	textobject.setFont("Helvetica-Oblique", 14)
	# 设置行距大小,单位为点
	leading = 8
	lyrics = ['well she hit Net Solutions',
             'and she registered her own .com site now',
             'and filled it up with yahoo profile pics',
             'she snarged in one night now',
             'and she made 50 million when HUgh Hefner',
             'boutght up the rights now',
             'and she\'ll have fun fun fun',
             'til her Daddy takes the keyboard away']
	for line in lyrics:
		# 应用行距
		textobject.setLeading(leading)
		textobject.textLine("%s: %s" %(leading,line))
		# 改变行距
		leading = leading+2.5
	textobject.setFillColorCMYK(0.8,0,0,0.3)
	textobject.textLines('''
	With many apologies to the Beach Boys
	and anyone else who finds this objectionable
	''')
	canvas.drawText(textobject)
        
c= canvas.Canvas("leading.pdf")
leading(c)
c.showPage()
c.save()

效果如下:
行距

上下标

setRise可以将文本设置为上下标。

python的reportlab安装及调用的问题 在《python》中有一个画pdf图的项目会用到reportlab模块,由于其不是标准库,所以需要自己安装第三方,在过程中我尝试了很多网上的教程都失败了(可能也有我自己的问题吧),所以 这篇是 给那些尝试了好多方法依然无法正常使用reportlab模块的新手朋友一个尝试 具体的是 这个百度经验里的方法  以下是要注意的部分 1. 按要求在python的官网制定位置下载一个. 阅读详情

相关推荐

python reportlab 生成pdf (二) SimpleDocTemplate

关于python reportlab 库的学习 二 SimpleDocTemplate 在使用SimpleDocTemplate之前,我们先看一下reportlab中,我们会在pdf中用到的一下类: styles字体样式字典:具体使用格式如下 from reportlab.lib.styles import getSampleStyleSheet styles=getSampleS

kingken212的专栏 1万+

python自动化办公之reportlab

分享代码

2301_76297780的博客 782

Python--reportlab 下载

Python的reportlab专门将数据使用生成PDF中的图形和文档功能。 官网是http://reportlab.org。可以下载到软件、文档和示例。 在 http://reportlab.org/downloads.html中可以找到对应的Python版本的工具包压缩档案文件,可根据自己使用的python版本下载对应的。 另附一个下载链接 http://www.reportl

小小希 4274

reportlab 生成pdf文件 (python)

2 应用场景 通过网页动态生成PDF文档 大量的报告和数据发布 用XML一步生成PDF 官网案例 3 PLATYPUS Platypus是“Page Layout and Typography Using Scripts”,是使用脚本的页面布局和印刷术的缩写,这是一个高层次页面布局库,它可以让你通过编程创造复杂的文档,并且毫不费力。Platypus设计的目的是尽可能地将高层布局设计与文档内容分离,比如,段落使用段落格式构造,页面使用页面模板,这样做是有好处的,在仅仅修改几行代码的情况下,包含数百个页面的

消极的人永远是对的,积极的人选择勇往直前 3802

python reportlab 生成多页pdf

【代码】python reportlab 生成多页pdf。

大鹏的专栏 1280

python reportlab 生成pdf (一)

关于python reportlab 库的学习 一 安装ReprotLab 从http://www.reportlab.org/oss/rl-toolkit/download/可以下载并安装ReportLab库,附带的用户指南说明了安装方法。 可以使用如下指令将ReprotLab库导入Python交互解释器以测试安装情况: >>> import reportlab   Demo

kingken212的专栏 5714

Python reportlab

python强大的PDF处理库reportlab,网上详细的教程比较少,这是我自己看它的user guide,摘选翻译并加入自己的理解写出来

TeamLee的博客 3445

python生成PDF文档的库reportlab

它提供了一系列用于创建和处理PDF文档的工具和函数,可以用于生成各种类型的PDF文件,例如报告、图表、表格等。然后,我们使用 Paragraph 类添加了一个标题和一些正文文本,使用 Image 类添加了一个图像,并使用 Table 类添加了一个表格。我们创建了一个 PDF 文档,并使用 SimpleDocTemplate 类来定义页面大小和边距,然后定义了一个名为 story 的列表,用于存储我们要添加到 PDF 中的内容。我们创建了一个名为“example.pdf”的PDF文档,并设置了其标题。

zhangzhechun的专栏 1576

python安装reportlab

python3.6安装reportlab的时候报错,错误信息如下: Collecting reportlab Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, ‘[SSL: CERTIFICA...

阳水平的博客 8804

Python生成PDF:ReportLab的使用方式

ReportLab是一个强大的Python库,用于生成PDF文档。它提供了丰富的功能和灵活的选项,使得在Python中生成高质量的PDF文档变得非常简单。本文将介绍如何使用ReportLab库来生成PDF文档,并提供相应的源代码示例。以上就是使用ReportLab库生成PDF文档的基本步骤和示例代码。接下来,我们可以向PDF文档中添加内容和样式。这行代码将在PDF文档的指定位置(100,750)添加文本"Hello World!这行代码将保存生成的PDF文档,并关闭文档对象。是生成的PDF文档的文件名,

BUG?不存在的! 879

Python reportlab库之Canvas

在上一篇《Python reportlab库之hello world》中我们演示了简单Demo,在Demo中使用Canvas对象。 from reportlab.pdfgen import canvas def hello(c): c.drawString(100,100,"Hello World") c = canvas.Canvas("hell...

iCloudEnd的博客 2319

python之reportlab

如果想使用python将数据生成为pdf格式的文件,那么使用reportlab可能是个比较好的选择 1.安装python,我的版本是python2.7的版本 2.安装Python Imaging Library (PIL),它的用处是“The Python Imaging Library (PIL) adds image processing capabilities to your

yoyo50411326的专栏 596

ECB oracle——attack

基于ECB oracle的攻击方案前言什么是ECB方案步骤1.确定块大小和明文大小2.暴力破解求明文脚本代码 前言 参考文章:Breaking ECB by prepending your own message. 环境地址:ECB oracle 什么是ECB 分组密码中AES的一种模式(其他还有:CBC、ECB、CTR、OCF、CFB)如图每一块加密是分开的。 方案步骤 1.确定块大小和明文大小 先用一个字符"a"去encrypt返回32个字节的数据(64位16进制)依次用"aa",“aaa”…去en

weixin_44617902的博客 1314

python 使用 reportlab 生成 pdf

生成 文件: 先 SimpleDocTemplate(‘xxx.pdf’),然后 build 流文件:先 io.BytesIO() 生成句柄,然后同理 曲线图 LinePlot 饼图 Pie 文字 Paragraph fontSize 字体大小 推荐 14 加粗 <b>xxx</b> 使用的是 html 的方式,字体自动实现 firstLineIndent 首行缩进 推荐 2 * fontSize leading 行间距 推荐 1.5 * fontSize fontName 中文不友好 下载 .ttf 文件

wolanx的博客 4165

Ubuntu技巧-Ubuntu远程访问之SSH反向代理

💡大家好,我是可夫小子,《小白玩转ChatGPT》专栏作者,关注AIGC、互联网和自媒体。要把内网的一台的Ubuntu服务器让外面也能访问,总共有三种可行的方案,前面已经介绍了两种方式,今天就来介绍更健壮稳定的方式——ssh反向代理。大概的框架图如下,今天就从服务器购买到设置,手把手的教程,让你花费100块以内,就拥有一个强大的「云服务器」。

可夫小子的频道 1156

新手必看!Cisco Packet Tracer 8.2从安装到完成第一个局域网实验(附常见问题解决)

本文为网络新手提供了Cisco Packet Tracer 8.2的完整入门指南。从官方下载安装、界面熟悉,到核心的拖拽设备、连线、配置IP地址三步操作,手把手教你完成第一个局域网组网实验。文章重点讲解了如何通过Ping命令验证连通性,并附带了连线错误、IP配置不当等常见问题的解决思路,帮助初学者快速上手这款强大的思科模拟器。

android的专栏 878

python绘图工具reportlab介绍

来源:http://blog.csdn.net/happyteafriends/article/details/9418341 转载原因:直接复制代码碰到点问题,等下记录下 官方介绍: Generating PDFs from Wall Street to Wikipedia We build solutions to generate rich, attrac

heybob的专栏 5859

不会写GLSL?用Cesium 1.120 + Heatmap.js 2.0.5也能搞定动态洪水模拟(附完整源码)

本文介绍了一种无需GLSL编程的3D洪水动态模拟方案,结合Cesium 1.120和Heatmap.js 2.0.5实现高效可视化。通过数据层、可视化层和集成层的技术降级方案,开发者可以快速构建专业级洪水演进效果,适用于应急管理、水利工程等场景。文章包含完整源码和性能优化技巧。

weixin_30329623的博客 526

python report_python之reportlab

如果想使用python将数据生成为pdf格式的文件,那么使用reportlab可能是个比较好的选择1.安装python,在之前的文章中可以知晓我安装的是python2.7的版本2.安装Python Imaging Library (PIL),它的用处是“The Python Imaging Library (PIL) adds image processing capabilities to yo...

weixin_42502896的博客 837

Pseudobulk与FindMarkers单细胞差异基因分析实战对比

本文深入对比了单细胞差异基因分析中Pseudobulk与FindMarkers两种主流方法。通过实战演示,详细解析了二者在底层逻辑、数据准备、分析流程及结果解读上的核心差异,并提供了基于不同生物学问题与数据特点的选择策略,帮助研究者做出更精准的分析决策。

weixin_29218963的博客 338

unity6000.0.3版本URP下ScriptableRendererFeature如何实现一张自定义贴图效果?

🏆本文收录于 《全栈 Bug 调优(实战版)》 专栏。专栏聚焦真实项目中的各类疑难 Bug,从成因剖析 → 排查路径 → 解决方案 → 预防优化全链路拆解,形成一套可复用、可沉淀的实战知识体系。无论你是初入职场的开发者,还是负责复杂项目的资深工程师,都可以在这里构建一套属于自己的「问题诊断与性能调优」方法论,助你稳步进阶、放大技术价值。

**My Coding Family** 595

python reportlab模块

参考链接: pyhton之Reportlab模块 https://www.cnblogs.com/hujq1029/p/7767980.html reportlab模块是用python语言生成pdf文件的模块 一、安装 #安装命令 pip install -U reportlab 首先需要在cmd窗口安装reportlab模块,成功安装的结果如下: 二、注册中文字体 reportlab模块默认...

JxufeCarol的博客 3204

第 8 篇:TMC2240 电机正反转实现|DIR 引脚控制 + 代码优化(稳定不抖动)

本文详细介绍了TMC2240电机驱动芯片的正反转实现方法,重点解决方向切换时的抖动和冲击问题。文章首先明确了硬件连接、基础配置和使能状态三个前提条件,然后阐述了DIR引脚电平控制方向的核心原理,提供了STM32的GPIO配置代码。针对方向切换时的电流冲击问题,作者提出了"停止-延迟-切换-启动"的平滑切换逻辑,并给出了包含方向枚举、转速控制和方向切换函数的完整代码实现方案。通过这种优化方法,可以有效避免电机在正反转切换时产生的抖动、冲击声和发热问题,实现稳定的双向控制。文章还提示了后续可

BackCatK Chen的博客 2090

python draw_Python reportlab 之 draw函数介绍

Python reportlab 之 draw函数介绍本节我们讲介绍一下操作canvas时经常用的工具API。在后续教程中我将会对每个工具进行详细介绍,本文把他们都介绍给大家,方便朋友们开发之用。Line methodscanvas.line(x1,y1,x2,y2)canvas.lines(linelist)用line和lines方法可以直接在canvas里绘制直线段Shape methodsc...

weixin_39521068的博客 1524

通过分子模板构建随机分布在溶液中的纳米颗粒(一)

通过分子模板构建随机分布在溶液中的纳米颗粒 要实现的目标: 1、可以循环建立多个水分子溶液的模型; 2、针对不同水分子数,自动创建文件夹; 3、运行完毕将所有结果自动存储在对应文件夹里; 分子模板的具体教程请见我的博客: https://blog.csdn.net/qq_43689832/article/details/104443175 1、首先,我们先建立纳米颗粒的分子模板,命名为p_30.txt: 包括两种原子类型。具体格式如下: # LAMMPS molecule file makin.

Rockyoung 2651

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

上一篇: Python reportlab
下一篇: OFD文档标准 1. 文档结构、命名空间和数据类型
垚武田
博客等级 码龄8年 614粉丝 61原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值