"Pyplot 박스플롯"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
6번째 줄: 6번째 줄:
;matplotlib 박스플롯
;matplotlib 박스플롯
;matplotlib.pyplot 박스플롯
;matplotlib.pyplot 박스플롯
<syntaxhighlight lang='python' notebook>
 
==예시 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

2021년 8월 1일 (일) 17:56 판

1 개요

pyplot boxplot
matplotlib boxplot
matplotlib.pyplot boxplot
pyplot 박스플롯
matplotlib 박스플롯
matplotlib.pyplot 박스플롯

2 예시 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()

3 예시 2

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()

4 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}