gpt4 book ai didi

python - 增加 seaborn 中的刻度标签字体大小

转载 作者:太空狗 更新时间:2023-10-29 18:02:47 25 4
gpt4 key购买 nike

我的 seaborn 图有一个大问题。出于某种原因,轴上的数字是用非常小的字体打印的,这使得它们不可读。我试着用

来缩放它们
with plt.rc_context(dict(sns.axes_style("whitegrid"),
**sns.plotting_context(font_scale=5))):
b = sns.violinplot(y="Draughts", data=dr)

没有帮助,这只会使轴文本变大,但不会使沿轴的数字变大。 See image

最佳答案

答案来自here使 seaborn 中的字体变大 ...

import pandas as pd, numpy as np, seaborn as sns
from matplotlib import pyplot as plt

# Generate data
df = pd.DataFrame({"Draughts": np.random.randn(100)})

# Plot using seaborn
sns.set(font_scale = 2)
b = sns.violinplot(y = "Draughts", data = df)
plt.show()

enter image description here

关于python - 增加 seaborn 中的刻度标签字体大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42404154/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com