각 서브 그림 아래에 x 축 레이블을 추가하고 싶습니다. 이 코드를 사용하여 차트를 만듭니다.각 matplotlib 서브 플로트에 대해 x 축 레이블을 표시하는 방법
fig = plt.figure(figsize=(16,8))
ax1 = fig.add_subplot(1,3,1)
ax1.set_xlim([min(df1["Age"]),max(df1["Age"])])
ax1.set_xlabel("All Age Freq")
ax1 = df1["Age"].hist(color="cornflowerblue")
ax2 = fig.add_subplot(1,3,2)
ax2.set_xlim([min(df2["Age"]),max(df2["Age"])])
ax2.set_xlabel = "Survived by Age Freq"
ax2 = df2["Age"].hist(color="seagreen")
ax3 = fig.add_subplot(1,3,3)
ax3.set_xlim([min(df3["Age"]),max(df3["Age"])])
ax3.set_xlabel = "Not Survived by Age Freq"
ax3 = df3["Age"].hist(color="cadetblue")
plt.show()
이것은 보이는 방식입니다. 첫 번째 사람은 내가 각 subplot
에서 다른 X 축 라벨을 보일 수있는 방법
보여줍니다?
이 게시물의 이름은 매우 혼란 스럽습니다. 이것은 축의 "제목"을 의미하지만 실제로 의미하는 것은 "x- 레이블"(x 축 아래의 텍스트)입니다. – pathoren