英文:
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})
英文:
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})
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论