【发布时间】:2021-07-16 02:15:52
【问题描述】:
我的情节与下面链接中回答的情节相似:
two DataFrame plot in a single plot matplotlip
我对@987654324@ 做了一些修改,因为我认为这是我必须修改的地方,但我无法产生输出。 我想要的情节样本是
这就是我修改它的方式:
f, axes = plt.subplots(nrows=len(signals.columns)+1, sharex=True, )
i = 0
for col in df2.columns:
fig, axs = plt.subplots()
sns.regplot(x='', y='', data=df2, ax=axs[0])
df2[col].plot(ax=axes[i], color='grey')
axes[i].set_ylabel(col)
i+=1
I have seen that its wrong.
我试过了,感觉不错:)
如何对此进行修改以获得我想要的:
f, axes = plt.subplots(nrows=len(signals.columns)+1, sharex=True, )
# plots for df2 columns
i = 0
for col in df2.columns:
lw=1
df2[col].plot(ax=axes[i], color='grey')
axes[i].set_ylim(0, 1)
axes[i].set_ylabel(col)
sns.rugplot(df2["P1"])
【问题讨论】:
-
顺便说一句,您是如何生成此图的?这是做功课吗?如果是,您应该自己尝试一下。
-
图表来自学习平台。不是家庭作业。
-
但重点是你要学习,对吧?您能否发布您尝试生成的代码以及最终的错误?
-
这是我尝试过的:
f, axes = plt.subplots(nrows=len(signals.columns)+1, sharex=True, ) i = 0 for col in df2.columns: fig, axs = plt.subplots() sns.regplot(x='', y='', data=df2, ax=axs[0]) df2[col].plot(ax=axes[i], color='grey') axes[i].set_ylabel(col) i+=1我已经看到这是绝对错误的! -
请编辑您的问题以发布您的代码
标签: python pandas numpy matplotlib