# Seaborn 多线图

Ammar Ali 2022年5月18日

## Seaborn 中的多线图

Seaborn 的 `lineplot()` 函数将数据绘制为一条线。我们必须将 x 和 y 轴值传递给函数来绘制一条线。如果我们想绘制多条线，我们必须为给定数据制作一个数据框，其中每列对应于每条线。

``````import seaborn as snNew
import pandas as pdNew
import matplotlib.pyplot as pltNew

array = [[11,1,0,2,0],
[3,8,0,1,0],
[0,16,3,0,0],
[0,0,12,0,0],
[0,0,0,13,0],
[0,1,0,0,16]]

DetaFrame_cm = pdNew.DataFrame(array, range(6), range(5))
snNew.lineplot(data=DetaFrame_cm)
pltNew.show()
``````

``````import seaborn as snNew
import pandas as pdNew
import matplotlib.pyplot as pltNew

array = [[11,1,0,2,0],
[3,8,0,1,0],
[0,16,3,0,0],
[0,0,12,0,0],
[0,0,0,13,0],
[0,1,0,0,16]]

DetaFrame_cm = pdNew.DataFrame(array, range(6), range(5))
snNew.lineplot(data=DetaFrame_cm,markers=['o','d','h','p','*'],palette='dark', legend=False, linewidth=2,ms=15, mec='r',mew=2,mfc='g')
pltNew.show()
``````

``````snNew.set(font_scale=1.5)
``````
Author: Ammar Ali

Hello! I am Ammar Ali, a programmer here to learn from experience, people, and docs, and create interesting and useful programming content. I mostly create content about Python, Matlab, and Microcontrollers like Arduino and PIC.