# 친구 수
friends = [70, 65, 72, 63, 71, 64, 60, 64, 67]
minutes = [175, 170, 205, 120, 220, 130, 105, 145, 190]
plt.scatter(friends, minutes)
plt.title('Minutes vs Friends')
plt.xlabel('# of Friends')
plt.ylabel('average time(minutes)')
plt.show()
friends = [70, 65, 72, 63, 71, 64, 60, 64, 67]
minutes = [175, 170, 205, 120, 220, 130, 105, 145, 190]
labels = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']
plt.scatter(friends, minutes)
for l, f, m in zip(labels, friends, minutes):
plt.annotate(l, xy=(f, m), xytext=(5, -5), textcoords='offset points')
plt.title('Minutes vs Friends')
plt.xlabel('# of Friends')
plt.ylabel('average time(minutes)')
plt.show()
math = [99, 90, 85, 97, 80]
science = [100, 85, 60, 90, 70]
plt.scatter(math, science)
plt.axis('equal')
plt.title('Science vs Math')
plt.xlabel('Math')
plt.ylabel('Science')
plt.show()
'Python > Python기초' 카테고리의 다른 글
Python 40_numpy package를 이용한 벡터 연산 (0) | 2020.01.15 |
---|---|
Python 39_ 선형대수(linear algebra) (0) | 2020.01.14 |
Python 37_matplotlib.pyplot 모듈을 사용한 데이터 시각화_ 막대 그래프 (0) | 2020.01.10 |
Python 36_matplotlib.pyplot 모듈을 사용한 데이터 시각화_ 선 그래프 (0) | 2020.01.09 |
Python 35_ Database 4 데이터 바인딩 Data Binding (0) | 2020.01.08 |
# 친구 수
friends = [70, 65, 72, 63, 71, 64, 60, 64, 67]
minutes = [175, 170, 205, 120, 220, 130, 105, 145, 190]
plt.scatter(friends, minutes)
plt.title('Minutes vs Friends')
plt.xlabel('# of Friends')
plt.ylabel('average time(minutes)')
plt.show()
friends = [70, 65, 72, 63, 71, 64, 60, 64, 67]
minutes = [175, 170, 205, 120, 220, 130, 105, 145, 190]
labels = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']
plt.scatter(friends, minutes)
for l, f, m in zip(labels, friends, minutes):
plt.annotate(l, xy=(f, m), xytext=(5, -5), textcoords='offset points')
plt.title('Minutes vs Friends')
plt.xlabel('# of Friends')
plt.ylabel('average time(minutes)')
plt.show()
math = [99, 90, 85, 97, 80]
science = [100, 85, 60, 90, 70]
plt.scatter(math, science)
plt.axis('equal')
plt.title('Science vs Math')
plt.xlabel('Math')
plt.ylabel('Science')
plt.show()
'Python > Python기초' 카테고리의 다른 글
Python 40_numpy package를 이용한 벡터 연산 (0) | 2020.01.15 |
---|---|
Python 39_ 선형대수(linear algebra) (0) | 2020.01.14 |
Python 37_matplotlib.pyplot 모듈을 사용한 데이터 시각화_ 막대 그래프 (0) | 2020.01.10 |
Python 36_matplotlib.pyplot 모듈을 사용한 데이터 시각화_ 선 그래프 (0) | 2020.01.09 |
Python 35_ Database 4 데이터 바인딩 Data Binding (0) | 2020.01.08 |