데이터분석/dataframe.plot
데이터프레임.plot xtick바꾸기
dohunNewte
2023. 4. 13. 14:53
반응형
df1 = df_last.groupby('연도')['평당분양가격'].mean()
fig=plt.figure(figsize=(10,3), dpi=100) # 액자설정
ax = fig.subplots(1,1) # 도화지설정
df1.plot.line(ax = ax)
t1 = ax.get_xticks() #현재 그래프의 x들을 가져옴
t2 = [x for x in t1 if x.is_integer()] #t1에 소수점도많은데 int일때만 가져오기
ax.set_xticks(t2) # x다시설정
fig.tight_layout()
728x90