일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- pymssql
- 크롤링
- sql developer
- rs422
- PYTHON MSSQL
- vscode
- matplot
- windows10
- Python
- 파이썬
- 윈도우10
- c#
- MX Component
- 티스토리 초대장
- 자본주의
- rs485
- oracle
- Serial
- 텐서플로우
- 오라클
- MSSQL PYTHON
- M2M
- 딥러닝
- MEAN Stack
- django
- tensorflow
- 장고
- scrapy
- MSSQL
- Visual Studio Code
Archives
- Today
- Total
안까먹을라고 쓰는 블로그
[Python] 모두의 데이터분석 with 파이썬 - 코드(matplot) 본문
반응형
List of named colors — Matplotlib 3.1.1 documentation
Note Click here to download the full example code List of named colors This plots a list of the named colors supported in matplotlib. Note that xkcd colors are supported as well, but are not listed here for brevity. For more information on colors in matplo
matplotlib.org
스터디 소스코드
import matplotlib.pyplot as plt
plt.plot([10, 20, 30, 40])
plt.show()
import matplotlib.pyplot as plt
plt.plot([1, 2, 3, 4], [12, 43, 25, 15])
plt.show()
import matplotlib.pyplot as plt
plt.title('plotting')
plt.plot([10, 20, 30, 40])
plt.show()
import matplotlib.pyplot as plt
plt.title('legend')
plt.plot([10, 20, 30, 40], label = 'asc') # 증가를 의미하는 asc 범례
plt.plot([40, 30, 20, 10], label = 'desc') # 감소를 의미하는 desc 범례
plt.legend(loc = 8)
plt.show()
import matplotlib.pyplot as plt
plt.title('color')
plt.plot([10, 20, 30, 40], color = 'skyblue', label = 'skyblue')
plt.plot([40, 30, 20, 10], 'pink', label='pink')
plt.legend()
plt.show()
import matplotlib.pyplot as plt
plt.title('linestyle')
plt.plot([10, 20, 30, 40], color = 'r', linestyle = '--', label = 'dashed')
plt.plot([40, 30, 20, 10], color = 'g', ls = ':', label = 'dotted')
plt.legend()
plt.show()
import matplotlib.pyplot as plt
plt.title('marker')
plt.plot([10, 20, 30, 40], 'r.', label = 'circle')
plt.plot([40, 30, 20, 10], 'g^', label = 'triangle up')
plt.legend()
plt.show()
import matplotlib.pyplot as plt
plt.hist([1, 1, 2, 3, 4, 5, 6, 6, 7, 8, 10])
plt.show()
import random
import matplotlib.pyplot as plt
dice = []
for i in range(1000000):
dice.append(random.randint(1,6))
# print(dice)
plt.hist(dice, bins = 6)
plt.show()
import matplotlib.pyplot as plt
# plt.bar([0, 1, 2, 4, 6, 10], [1, 2, 3, 5, 6, 7])
plt.bar([0, 3, 2, 1, 6, 10], [1, 2, 3, 4, 6, 7])
plt.show()
import matplotlib.pyplot as plt
plt.bar(range(6), [1, 2, 3, 5, 6, 7])
plt.show()
import matplotlib.pyplot as plt
import random
import numpy as np
result = []
for i in range(13):
result.append(random.randint(1, 1000))
print(sorted(result))
result2 = np.array(result)
print("1/4 : " + str(np.percentile(result, 25)))
print("2/4 : " + str(np.percentile(result, 50)))
print("3/4 : " + str(np.percentile(result, 75)))
plt.boxplot(result)
plt.show()
import matplotlib.pyplot as plt
plt.pie([10, 20])
plt.show()
import matplotlib.pyplot as plt
size = [2441, 2312, 1031, 1233]
plt.axis('equal')
plt.pie(size)
plt.show()
import matplotlib.pyplot as plt
plt.rc('font', family = 'Malgun Gothic')
size = [2441, 2312, 1031, 1233]
label = ['A형', 'B형', 'AB형', 'O형']
plt.axis('equal')
plt.pie(size, labels = label)
plt.show()
import matplotlib.pyplot as plt
plt.rc('font', family = 'Malgun Gothic')
size = [2441, 2312, 1031, 1233]
label = ['A형', 'B형', 'AB형', 'O형']
plt.axis('equal')
plt.pie(size, labels = label, autopct = '%.1f%%')
plt.legend()
plt.show()
import matplotlib.pyplot as plt
plt.rc('font', family = 'Malgun Gothic')
size = [2441, 2312, 1031, 1233]
label = ['A형', 'B형', 'AB형', 'O형']
color = ['darkmagenta', 'deeppink', 'hotpink', 'pink']
plt.axis('equal')
plt.pie(size, labels = label, autopct = '%.1f%%', colors = color, explode = (0, 0, 0.2, 0))
plt.legend()
plt.show()
반응형
'Language > Python' 카테고리의 다른 글
[Python] 모두의 데이터분석 with 파이썬 - 코드1 (인구통계데이터 + matplot) (0) | 2019.10.21 |
---|---|
[Python] 모두의 데이터분석 with 파이썬 - 코드(기상데이터 + matplot) (0) | 2019.10.21 |
[Python] 모두의 데이터분석 with 파이썬 - 코드(기상데이터) (0) | 2019.10.21 |
[Python과 텐서플로우를 활용한 딥러닝 기본 향상과정] 2일차 (0) | 2019.10.19 |
[Python] 모두의 데이터분석 with 파이썬 - 참고자료 (0) | 2019.10.15 |
Comments