用于创建绘图的 Python 代码如下。这将根据以下内容创建子图"variable":
s=sb.relplot(x="timestamp",y="value",hue="variable",row="variable",
kind="line",facet_kws=dict(sharey=False),height=0.8, aspect=7,data=e)
plt.axvline(flip_timex)
s.fig.autofmt_xdate()
plt.show()
Run Code Online (Sandbox Code Playgroud)
我需要在生成的所有子图上添加一条垂直线(在固定日期)。
plt.axvline(flip_timex)仅在一个子图上添加一条垂直线。
您需要在所有生成的图中创建线条。
grid = seaborn.relplot(...)
for ax in grid.axes.flat:
ax.axvline(...)
Run Code Online (Sandbox Code Playgroud)