df
바로 plt.plot으로 그려본다. 밋밋하다
배운거 한가지씩 해보려고하니까 복잡해졌다.
grid는 전역설정 방법이 plt.rcParams['axes.grid'] = True
십자무늬 grid가 생긴다. 나는 y축만하고싶어서 plt.grid(axis='y')로 했다
enumerate에 df['영어']같은 Series도 가능할까했는데 넣어보니까 됐다.
plt.plot(df['지원번호'], df['영어'], label='영어점수', color = 'blue')
plt.plot(df['지원번호'], df['수학'], label='수학점수', color = 'red')
for idx, txt in enumerate(df['영어']):
plt.text(df['지원번호'][idx], df['영어'][idx], txt, color='blue')
for idx, txt in enumerate(df['수학']):
plt.text(df['지원번호'][idx], df['수학'][idx], txt, color='red')
plt.grid(axis='y', color='purple', alpha=0.9, ls='--', linewidth = 1.5)
plt.legend()
'파이썬. 데이터분석 > Matplotlib' 카테고리의 다른 글
matplotlib : 누적 막대그래프 (0) | 2022.07.12 |
---|---|
matplotlib : 막대 그래프별 색,xticks (0) | 2022.07.12 |
matplotlib : 선 그래프 여러개 그리기 (0) | 2022.07.10 |
matplotlib : 선그래프 색,marker, 배경색,linestyles (0) | 2022.07.10 |
matplotlib : 범례(legend) (0) | 2022.07.09 |