PythonSeabornpip install seabornimport seaborn as snssns.set_style()sns.set_style()
whitegrid dark white ticks
sns.set()
sns.set_style(darkgrid)
sns.set_style(whitegrid)
sns.set_style(dark)
sns.set_style(white)
sns.set_style(ticks)
sns.set()set()set_style()
bugrelplot()”ticks”seabornmatplotlibmatplotlibseaborn
sns.set_style()
plt.rcParams[font.sans-serif] = [SimHei]sns.despine()seaborn replot()scatter()replotkindscatter
hue Asns.set_style(darkgrid)
plt.rcParams[font.sans-serif] = [SimHei]
sns.relplot(x=, y=A, data=df1, color=red)
plt.show()A
sns.set_style(whitegrid)
plt.rcParams[font.sans-serif] = [SimHei]
sns.relplot(x=, y=A, hue=, data=df1)
plt.show()ABCx[0,2,4,6,8]
tickssns.set_style(ticks)
plt.rcParams[font.sans-serif] = [STKAITI]
df2 = df1.copy()
df2.index = list(range(0, len(df2)*2, 2))
dfs = [df2[A], df2[B], df2[C]]
sns.scatterplot(data=dfs)
plt.show()seaborn replot()lineplot()sns.replot()kind”line”
A
sns.set(rc={font.sans-serif: STKAITI})
sns.relplot(x=, y=A, data=df1, color=purple, kind=line)
plt.title(, fontsize=18)
plt.xlabel(num, fontsize=18)
plt.ylabel(A, fontsize=16)
plt.subplots_adjust(left=0.15, right=0.9, bottom=0.1, top=0.9)
plt.show()
Awhitegridsns.set_style(whitegrid)
plt.rcParams[font.sans-serif] = [STKAITI]
sns.relplot(x=, y=A, hue=, data=df1, kind=line)
plt.title(, fontsize=18)
plt.xlabel(num, fontsize=18)
plt.ylabel(A, fontsize=16)
plt.subplots_adjust(left=0.15, right=0.9, bottom=0.1, top=0.9)
plt.show()
ABCx[0,2,4,6,8]
darkgridxysns.set_style(darkgrid)
plt.rcParams[font.sans-serif] = [STKAITI]
df2 = df1.copy()
df2.index = list(range(0, len(df2)*2, 2))
dfs = [df2[A], df2[B], df2[C]]
sns.relplot(data=dfs, kind=line)
plt.title(, fontsize=18)
plt.xlabel(num, fontsize=18)
plt.ylabel(A, fontsize=16)
plt.subplots_adjust(left=0.15, right=0.9, bottom=0.1, top=0.9)
plt.show()
colsns.set_style(darkgrid)
plt.rcParams[font.sans-serif] = [STKAITI]
sns.relplot(data=df1, x=A, y=B, kind=line, col=)
plt.subplots_adjust(left=0.05, right=0.95, bottom=0.1, top=0.9)
plt.show() rowsns.set_style(darkgrid)
plt.rcParams[font.sans-serif] = [STKAITI]
sns.relplot(data=df1, x=A, y=B, kind=line, row=)
plt.subplots_adjust(left=0.15, right=0.9, bottom=0.1, top=0.95)
plt.show()lineplot()sns.set_style(darkgrid)
plt.rcParams[font.sans-serif] = [STKAITI]
sns.lineplot(x=, y=A, data=df1, color=purple)
plt.title(, fontsize=18)
plt.xlabel(num, fontsize=18)
plt.ylabel(A, fontsize=16)
plt.subplots_adjust(left=0.15, right=0.9, bottom=0.1, top=0.9)
plt.show()sns.set_style(darkgrid)
plt.rcParams[font.sans-serif] = [STKAITI]
df2 = df1.copy()
df2.index = list(range(0, len(df2)*2, 2))
dfs = [df2[A], df2[B], df2[C]]
sns.lineplot(data=dfs)
plt.title(, fontsize=18)
plt.xlabel(num, fontsize=18)
plt.ylabel(A, fontsize=16)
plt.subplots_adjust(left=0.15, right=0.9, bottom=0.1, top=0.9)
plt.show()sns.displot()bins=6
rug=True x
kde=Truesns.set_style(darkgrid)
plt.rcParams[font.sans-serif] = [STKAITI]
sns.displot(data=df1[[C]], bins=6, rug=True, kde=True)
plt.title(, fontsize=18)
plt.xlabel(C, fontsize=18)
plt.ylabel(, fontsize=16)
plt.subplots_adjust(left=0.15, right=0.9, bottom=0.1, top=0.9)
plt.show()300sns.set_style(darkgrid)
plt.rcParams[font.sans-serif] = [STKAITI]
np.random.seed(13)
Y = np.random.randn(300)
sns.displot(Y, bins=9, rug=True, kde=True)
plt.title(, fontsize=18)
plt.xlabel(C, fontsize=18)
plt.ylabel(, fontsize=16)
plt.subplots_adjust(left=0.15, right=0.9, bottom=0.1, top=0.9)
plt.show()barplot()
xAy
sns.set_style(darkgrid)
plt.rcParams[font.sans-serif] = [STKAITI]
sns.barplot(x=, y=A, hue=, data=df1)
plt.title(, fontsize=18)
plt.xlabel(, fontsize=18)
plt.ylabel(, fontsize=16)
plt.subplots_adjust(left=0.15, right=0.9, bottom=0.15, top=0.9)
plt.show()lmplot()
x, y, dataxy
hue
col
row
col_wrap
size
markers
X Y sns.set_style(darkgrid)
plt.rcParams[font.sans-serif] = [STKAITI]
sns.lmplot(x=A, y=B, data=df1)
plt.title(, fontsize=18)
plt.xlabel(A, fontsize=18)
plt.ylabel(B, fontsize=16)
plt.subplots_adjust(left=0.15, right=0.9, bottom=0.15, top=0.9)
plt.show()kdeplot()
AB
shadeTruesns.set_style(darkgrid)
plt.rcParams[font.sans-serif] = [STKAITI]
sns.kdeplot(df1[A], shade=True, data=df1, color=r)
sns.kdeplot(df1[B], shade=True, data=df1, color=g)
plt.title(, fontsize=18)
plt.xlabel(Value, fontsize=18)
plt.subplots_adjust(left=0.15, right=0.9, bottom=0.15, top=0.9)
plt.show()sns.jointplot()kind”kde”darkplt.rcParams[font.sans-serif] = [STKAITI]
sns.jointplot(x=df1[A], y=df1[B], kind=kde, space=0)
plt.show()boxplot()
x, y, data
hue
width
notch Falsenp.random.seed(13)
Y = np.random.randint(20, 150, 360)
df2 = pd.DataFrame(
{: [001, 001, 001, 002, 002, 002, 003, 003, 003, 004, 004, 004] * 30,
: [AAA, BBB, CCC, AAA, BBB, CCC, AAA, BBB, CCC, AAA, BBB, CCC] * 30,
XXX: Y
}
)plt.rcParams[font.sans-serif] = [STKAITI]
sns.boxplot(x=, y=XXX, data=df2)
plt.show()xyplt.rcParams[font.sans-serif] = [STKAITI]
sns.boxplot(y=, x=XXX, data=df2)
plt.show()plt.rcParams[font.sans-免费云主机域名serif] = [STKAITI]
sns.boxplot(x=, y=XXX, data=df2, hue=)
plt.show()
violinplot()plt.rcParams[font.sans-serif] = [STKAITI]
sns.violinplot(x=, y=XXX, data=df2)
plt.show()plt.rcParams[font.sans-serif] = [STKAITI]
sns.violinplot(x=XXX, y=, data=df2)
plt.show()plt.rcParams[font.sans-serif] = [STKAITI]
sns.violinplot(x=, y=XXX, data=df2, hue=)
plt.show()import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
plt.figure(figsize=(6,6))
plt.rcParams[font.sans-serif] = [STKAITI]
s1 = np.random.randint(0, 200, 33)
s2 = np.random.randint(0, 200, 33)
s3 = np.random.randint(0, 200, 33)
s4 = np.random.randint(0, 200, 33)
s5 = np.random.randint(0, 200, 33)
s6 = np.random.randint(0, 200, 33)
s7 = np.random.randint(0, 200, 33)
data = pd.DataFrame(
{: s1,
: s2,
: s3,
:s4,
:s5,
:s6,
:s7
}
)
plt.title()
sns.heatmap(data, annot=True, fmt=d, lw=0.5)
plt.xlabel()
plt.ylabel()
x = [1, 2, 3, 4, 5, 6, 7]
plt.xticks(range(0, 7, 1), x, ha=left)
plt.show()PythonSeaborn
这篇文章主要介绍“MySQL数据持久化过程实例分析”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“MySQL数据持久化过程实例分析”文章能帮助大家解决问题。理解MySQL数据的持久化过程,能很好的帮助我们加深对于MySQ…
免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。