简体   繁体   English

如何调整海洋图中的x轴标签?

[英]How to adjust x axis labels in a seaborn plot?

I am trying to plot histogram similar to this: Actual plot 我正在尝试绘制类似于以下的直方图: 实际图

However, I am unable to customize the x axis labels similar to the above figure. 但是,我无法自定义类似于上图的x轴标签。 My seaborn plot looks something like this, my plot 我的海底情节看起来像这样, 我的情节

I want the same x-axis labels ranging from 0 to 25000 with equal interval of 5000. It would be great if anyone can guide me in the right direction? 我想要相同的x轴标签,范围从0到25000,等间隔为5000。如果有人可以向正确的方向引导我,那将是很好的选择?

Code for my figure: 我的身材代码:

sns.set_style('darkgrid')
kws = dict(linewidth=.3, edgecolor='k')
g = sns.FacetGrid(college, hue='Private',size=6, aspect=2, palette = 'coolwarm')
g = g.map(plt.hist, 'Outstate', bins=24,alpha = 0.7,**kws).add_legend()

您应该只需添加以下内容即可:

plt.xticks(np.linspace(start=0, stop=25000, num=6))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM