Python:叠加和平滑图形
我有100种不同的图形,它们看起来像 我需要叠加所有这些和下一个平滑的结果。 我试试这个Python:叠加和平滑图形,python,matplotlib,Python,Matplotlib,我有100种不同的图形,它们看起来像 我需要叠加所有这些和下一个平滑的结果。 我试试这个 import Image first = Image.open("test1.png") second = Image.open("test2.png") first.paste(second, (0, 0), second) first.show() 但是我怎样才能做到100个图形呢?我怎样才能使结果平滑? dataframe中的前10个步骤如下所示 active nodes gra
import Image
first = Image.open("test1.png")
second = Image.open("test2.png")
first.paste(second, (0, 0), second)
first.show()
但是我怎样才能做到100个图形呢?我怎样才能使结果平滑?
dataframe中的前10个步骤如下所示
active nodes
graph
0 1024
1 598
2 349
3 706
4 541
5 623
6 576
7 614
8 578
9 613
10 595
你把它当作一个图像,或者你也有制作图表的数据? 如果你有数据,最简单的平滑方法就是使用卷积
你说的平滑到底是什么意思?@Petar我需要从所有这些图形中得到平均曲线如果你没有数据,你就不能这样做。@Peter我可以得到数据。我怎样才能用数据做到这一点?你必须在你的问题中向任何人展示一个数据样本来回答这个问题。我只有图像
n=100
smoothed_data=np.convolve(data,[1/n]*n,'same')