본문 바로가기
데이터분석/dataframe.plot

데이터프레임.plot xtick바꾸기

by dohunNewte 2023. 4. 13.
반응형

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

'데이터분석 > dataframe.plot' 카테고리의 다른 글

데이터프레임 2개 시각화  (0) 2023.04.13

댓글