Seaborn Implot에 제목을 추가하려면 다음 단계를 따르세요.-
- 그림 크기를 설정하고 서브플롯 사이 및 주변 여백을 조정합니다.
- X축과 Y축의 두 열이 있는 Pandas 데이터 프레임 만들기
- implot() 사용 방법.
- gca()를 사용하여 현재 축 가져오기 방법.
- 그림을 표시하려면 show()를 사용하세요. 방법.
예시
import pandas
import matplotlib.pylab as plt
import seaborn as sns
import numpy as np
plt.rcParams["figure.figsize"] = [7.50, 3.50]
plt.rcParams["figure.autolayout"] = True
df = pandas.DataFrame({"X-Axis": [np.random.randint(10) for i in range(10)], "Y-Axis": [i for i in range(10)]})
bar_plot = sns.lmplot(x='X-Axis', y='Y-Axis', data=df, height=3.5)
ax = plt.gca()
ax.set_title("Random Data Implot")
plt.show() 출력
