gpt4 book ai didi

python - seaborn 因子图的线型和 x_jitter

转载 作者:行者123 更新时间:2023-12-02 03:23:27 26 4
gpt4 key购买 nike

Seaborn 因子图很棒,但我如何影响线条样式(例如虚线等以提高黑白可读性)。以及如何应用“x_jitter”以使不同的置信区间不会相互遮挡?谢谢!

这是一个没有应用这些更改的示例。

>>> import seaborn as sns
>>> sns.set(style="ticks")
>>> exercise = sns.load_dataset("exercise")
>>> g = sns.factorplot(x="time", y="pulse", hue="kind", data=exercise)

最佳答案

确保包含完整解决方案的简短说明,而不仅仅是链接。

sns.factorplot 将附加参数转发给底层绘图函数。在您的示例中,sns.pointplot 用于绘制数据,您可以将参数 linewidthsdodge 传递给此函数:

sns.factorplot(x="time", y="pulse", hue="kind", data=exercise, dodge=0.2, linestyles='dashed')

enter image description here

关于python - seaborn 因子图的线型和 x_jitter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31684645/

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