파이썬 시각화 - 바이올린플롯을 그라데이션으로 숫자의 크기를 표현하고 싶다면?
게시일 : 2019.09.14 17:17
바이올린플롯 그라데이션 색상으로 크고 작음 표현하기 - violin plot color pal
Violinplots with observations
https://seaborn.pydata.org/examples/simple_violinplots.html


import numpy as np
import seaborn as sns
%matplotlib inline

sns.set(style='whitegrid')
# Create a random dataset across several variables
rs = np.random.RandomState(0)
n, p = 40, 8
d = rs.normal(0, 2, (n, p))
d += np.log(np.arange(1, p + 1)) * -5 + 10
import pandas as pd
pd.DataFrame(d).sample()
# Use cubehelix to get a custom sequential palette
pal = sns.cubehelix_palette(p, rot=-.5, dark=.3)
sns.palplot(pal)
# Show each distribution with both violins and points
sns.violinplot(data=d, palette=pal, inner="quartile")

인프런 강좌
http://bit.ly/inflearn_todaycode
댓글 0
0/3000

추천영상