잔글 (Jmnote님이 Pyplot 박스폴롯 문서를 Pyplot 박스플롯 문서로 이동했습니다) |
(→예시 2) |
||
(사용자 2명의 중간 판 8개는 보이지 않습니다) | |||
3번째 줄: | 3번째 줄: | ||
;matplotlib boxplot | ;matplotlib boxplot | ||
;matplotlib.pyplot boxplot | ;matplotlib.pyplot boxplot | ||
;pyplot | ;pyplot 박스플롯 | ||
;matplotlib | ;matplotlib 박스플롯 | ||
;matplotlib.pyplot | ;matplotlib.pyplot 박스플롯 | ||
< | |||
==예시 1== | |||
<syntaxhighlight lang='python' notebook=1> | |||
import pandas as pd | |||
import matplotlib.pyplot as plt | |||
df = pd.read_csv("https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv") | |||
_, ax = plt.subplots() | |||
ax.boxplot(df['sepal_width']) | |||
plt.show() | |||
</syntaxhighlight> | |||
==예시 2== | |||
<syntaxhighlight lang='python' notebook=2> | |||
import numpy as np | import numpy as np | ||
import matplotlib.pyplot as plt | import matplotlib.pyplot as plt | ||
13번째 줄: | 26번째 줄: | ||
samp2 = np.random.normal(loc=1, scale=2, size=100) | samp2 = np.random.normal(loc=1, scale=2, size=100) | ||
samp3 = np.random.normal(loc=0.3, scale=1.2, size=100) | samp3 = np.random.normal(loc=0.3, scale=1.2, size=100) | ||
_, ax = plt.subplots(1, 1, figsize=(8,6)) | |||
ax.boxplot((samp1, samp2, samp3)) | ax.boxplot((samp1, samp2, samp3)) | ||
ax.set_xticklabels(['sample 1','sample 2','sample 3']) | ax.set_xticklabels(['sample 1','sample 2','sample 3']) | ||
plt.show() | plt.show() | ||
</ | </syntaxhighlight> | ||
==같이 보기== | ==같이 보기== | ||
* [[박스플롯]] | |||
* [[matplotlib]] | * [[matplotlib]] | ||
* [[ | * [[Python 박스플롯]] | ||
[[분류: pyplot]] | [[분류: pyplot]] | ||
[[분류: Python 차트]] |
2021년 8월 1일 (일) 17:56 기준 최신판
1 개요[ | ]
- pyplot boxplot
- matplotlib boxplot
- matplotlib.pyplot boxplot
- pyplot 박스플롯
- matplotlib 박스플롯
- matplotlib.pyplot 박스플롯
2 예시 1[ | ]
Python
Reload
Copy
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv("https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv")
_, ax = plt.subplots()
ax.boxplot(df['sepal_width'])
plt.show()
Loading
3 예시 2[ | ]
Python
Reload
Copy
import numpy as np
import matplotlib.pyplot as plt
samp1 = np.random.normal(loc=0, scale=1, size=100)
samp2 = np.random.normal(loc=1, scale=2, size=100)
samp3 = np.random.normal(loc=0.3, scale=1.2, size=100)
_, ax = plt.subplots(1, 1, figsize=(8,6))
ax.boxplot((samp1, samp2, samp3))
ax.set_xticklabels(['sample 1','sample 2','sample 3'])
plt.show()
Loading
4 같이 보기[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.