이라는 유용한 내장 함수를 제공하여 다양한 면을 나타내는 그래프를 쉽게 그릴 수 있게 도와
준다(그림
9
-
26
).
In
[
108
]:
sns
.
factorplot
(
x
=
'
day
',
y
=
'
tip
_
pct
',
hue
=
'
time
',
col
=
'
smoker
',
.....:
kind
=
'
bar
',
data
=
tips
[
tips
.
tip
_
pct
<
1
])
그림
9-26
요일/시간/흡연 여부에 따른 팁 비율
'
time
'
으로 그룹을 만드는 대신 패싯 안에서 막대그래프의 색상을 달리해서 보여줄 수 있다.
또한 패싯 그리드에
time
값에 따른 그래프를 추가할 수도 있다(그림
9
-
27
).
In
[
109
]:
sns
.
factorplot
(
x
=
'
day
',
y
=
'
tip
_
pct
',
row
=
'
time
',
.....:
col
=
'
smoker
',
.....:
kind
=
'
bar
',
data
=
tips
[
tips
.
tip
_
pct
<
1
])
381
9
장
그래프와 시각화
그림
9-27
요일별
tip
_
pct
. 시간과 흡연 여부도 함께 나타냄
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.