gpt4 book ai didi

用于 y-log 比例拟合的 python seaborn lmplot regplot

转载 作者:行者123 更新时间:2023-11-28 21:50:46 25 4
gpt4 key购买 nike

我想知道为什么 seaborn lmplot 和 regplot 只能选择做 logx。我经常使用线性拟合 log(y) ~ x 并且 Y 轴应始终采用对数刻度以显示相关性(作为惯例)。

这是可以在 Seaborn 中完成的事情吗?

logy=True 的选项会很好...

谢谢。

最佳答案

您可以简单地设置 y 轴刻度以记录:

import seaborn as sns; sns.set(color_codes=True)
tips = sns.load_dataset("tips")
ax = sns.regplot(x="total_bill", y="tip", data=tips)
ax.set_yscale('log') # set_yscale is a function, not a string

关于用于 y-log 比例拟合的 python seaborn lmplot regplot,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31467655/

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