Python 将AxeSubPlot的pyplot数组耦合到地物对象

Python 将AxeSubPlot的pyplot数组耦合到地物对象,python,pandas,matplotlib,Python,Pandas,Matplotlib,我有一个pandas数据帧,我正在使用df.plot函数制作一个包含子图的面板 大概是这样的: x = np.random.randn(50) df = pd.DataFrame({'1': x, '2': x, '3': x, '4':x}) ax_lst = df.plot(subplots = True, layout = (2,2)) plot函数返回axessSubplot的numpy数组。如何将其耦合到地物对象,以便更改地物级别属性 我尝试过这个,但没有成功: fig = plt

我有一个pandas数据帧,我正在使用df.plot函数制作一个包含子图的面板

大概是这样的:

x = np.random.randn(50)
df = pd.DataFrame({'1': x, '2': x, '3': x, '4':x})

ax_lst = df.plot(subplots = True, layout = (2,2))
plot函数返回axessSubplot的numpy数组。如何将其耦合到地物对象,以便更改地物级别属性

我尝试过这个,但没有成功:

fig = plt.figure()
fig.axes.append(ax_lst)

每个
对象都有一个方法。就你而言

fig = ax_lst[0].get_figure()

用这样的东西

ax_lst = df['1'].plot(color='green', linewidth=2.0)
ax_lst1 = df['2'].plot(color='blue',linestyle=':')
.
.
您可以在
df.plot()的特定范围内修改任何绘图。

或者你可以使用子图。