我有一个 2 行 1 列的简单 FacetGrid,其中的线图表示构面的不同类别 - 如下图。
# lineplot for each Category over the last three years
g = sns.FacetGrid(df, row="Category", sharey=False, sharex=False, height=2.5, aspect = 3)
g = g.map(plt.plot, 'Date', 'Count')
Run Code Online (Sandbox Code Playgroud)
如何添加显示每个方面的平均计数的参考线和注释?
# lineplot for each Category over the last three years
g = sns.FacetGrid(df, row="Category", sharey=False, sharex=False, height=2.5, aspect = 3)
g = g.map(plt.plot, 'Date', 'Count')
Run Code Online (Sandbox Code Playgroud)
df.head()import pandas as pd
data = {'Category': ['Group 1', 'Group 1', 'Group 1', 'Group 1', 'Group 1', 'Group …Run Code Online (Sandbox Code Playgroud)