기본적으로 서브 플롯 옵션을 사용하는 pandas.DataFrame.plot ()은 서브 플롯 당 ylabel을 쉽게 그릴 수없는 것 같습니다. 데이터 프레임의 열당 서브 플롯이있는 팬더 데이터 프레임을 플로팅하려고합니다. 지금까지 작동하지 않는 코드 :
fig = plt.figure(figsize=(10,10))
ax = plt.gca()
df.plot(y=vars, ax=ax, subplots=True, layout=(3,1), sharex=True, legend=False,)
ax.set_ylabel = ['y','x', 'z']
그러나 이것은 레이블을 전혀 표시하지 않습니다.
각 축에 개별적으로 y 레이블을 설정할 수 있습니다.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# data
df = pd.DataFrame(np.random.randn(100,3), columns=list('ABC'))
# plot
axes = df.plot(figsize=(10, 10), subplots=True, sharex=True, legend=False)
axes[0].set_ylabel('yA')
axes[1].set_ylabel('yB')
axes[2].set_ylabel('yC')
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다