如何启用FacetGrid的顶部和右侧脊柱。

huangapple go评论63阅读模式
英文:

How to enable the top and right spines of a FacetGrid

问题

我尝试使用sns.set_style("white"),但脊梁只覆盖底部和左侧。如何将脊梁设置在图形的四周?

我还尝试了plt.subplots_adjust(right=0.1, top=0.1),以查看脊梁是否仅因大小而被隐藏,但我收到一条消息说左侧和底部需要大于右侧和顶部。

英文:

I tried using sns.set_style("white"), but the spines only cover the bottom and left side. How can I set the spines all around the figure?

I also tried plt.subplots_adjust(right=0.1, top=0.1) to see if the spines were just hidden by the size, but I got a message that left and bottom needs to be bigger than right and top.

答案1

得分: 1

The underlying FacetGrid automatically "despines" its figures, but you can disable this behavior using the facet_kws parameter:

import seaborn as sns
df = sns.load_dataset("titanic")
sns.catplot(data=df, x="age", y="class", facet_kws={"despine": False})

如何启用FacetGrid的顶部和右侧脊柱。

英文:

The underlying FacetGrid automatically "despines" its figures, but you can disable this behavior using the facet_kws parameter:

import seaborn as sns
df = sns.load_dataset("titanic")
sns.catplot(data=df, x="age", y="class", facet_kws={"despine": False})

如何启用FacetGrid的顶部和右侧脊柱。

huangapple
  • 本文由 发表于 2023年5月25日 23:48:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/76334145.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定