Seaborn Boxplot - 轴颜色和宽度
Seaborn Boxplot - axis color and width
我正在使用 seaborn 创建箱线图。如何修改轴线粗细和颜色?
我不知道在我的代码中哪里可以解决这个问题。我需要更改 x 轴的颜色和宽度,使其变蓝变粗....
谢谢
plt.figure()
fig = plt.figure(figsize=(45,35), dpi=150)
font_size_axes=128
label_font_size=128
ax = sns.boxplot(x=group, y=strain_lable[:], data=table,order=data_order, palette=my_pal, width=0.3,
fliersize=50, linewidth=12)
ax.spines['left'].set_linewidth(5)
ax.spines['left'].set_color('orange')
如果需要给所有的书脊上色,可以循环:
for _,s in ax.spines.items():
s.set_linewidth(5)
s.set_color('cyan')
如果您想对一堆绘图进行这些更改,您可以考虑更改 rc 文件(请参阅 "Customizing matplotlib")。相关属性是 'axes.linewidth'
和 'axes.edgecolor'
我正在使用 seaborn 创建箱线图。如何修改轴线粗细和颜色?
我不知道在我的代码中哪里可以解决这个问题。我需要更改 x 轴的颜色和宽度,使其变蓝变粗....
谢谢
plt.figure()
fig = plt.figure(figsize=(45,35), dpi=150)
font_size_axes=128
label_font_size=128
ax = sns.boxplot(x=group, y=strain_lable[:], data=table,order=data_order, palette=my_pal, width=0.3,
fliersize=50, linewidth=12)
ax.spines['left'].set_linewidth(5)
ax.spines['left'].set_color('orange')
如果需要给所有的书脊上色,可以循环:
for _,s in ax.spines.items():
s.set_linewidth(5)
s.set_color('cyan')
如果您想对一堆绘图进行这些更改,您可以考虑更改 rc 文件(请参阅 "Customizing matplotlib")。相关属性是 'axes.linewidth'
和 'axes.edgecolor'