【问题标题】:Increasing the frequency of xticks in python seaborn plots增加 python seaborn 图中 xticks 的频率
【发布时间】:2020-10-28 02:25:09
【问题描述】:

我使用 Python seaborn 库绘制了一个包含 15 个子图的 FacetGrid 图。 x 轴上的数据点数为 23 (0 t0 23)。我希望它们都显示在 x 轴上。 这是情节代码-

g = sns.FacetGrid(dataset, col="City",col_wrap=4 ,height=4, aspect=1.5)
g = g.map(sns.lineplot, "Block",'temp_error',color='#EE0000')

这是图表的快照-

【问题讨论】:

标签: python seaborn


【解决方案1】:

您可以使用以下命令设置 xticks。您必须在 xticks 参数中传递 xticks 列表。

g.set(xticks=np.arange(24))

希望这会有所帮助。

【讨论】:

    猜你喜欢
    • 2014-09-24
    • 1970-01-01
    • 1970-01-01
    • 2020-09-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-15
    相关资源
    最近更新 更多