もしSeabornでなくても良いならば、例えば以下のようなやり方があります。
python
1from matplotlib import pyplot as pp
2from matplotlib import gridspec
3
4#Define grid for subplots
5gs = gridspec.GridSpec(2, 2, width_ratios=[3, 1], height_ratios = [1, 4])
6
7#Create scatter plot
8fig = pp.figure()
9ax = pp.subplot(gs[1, 0])
10cax = ax.scatter(data[0], data[1], color='darkred', alpha=.4)
11
12#Turn off all axes
13_=ax.axis('off')
14
15#Create Y-marginal (right)
16axr = pp.subplot(gs[1, 1], sharey=ax, xticks=[], yticks=[],frameon = False, xlim=(0, 1), ylim = (ymin, ymax))
17axr.hist(data[1], color = '#5673E0', orientation = 'horizontal', normed = True)
18
19#Create X-marginal (top)
20axt = pp.subplot(gs[0,0], sharex=ax,frameon = False, xticks = [], yticks = [], xlim = (xmin, xmax), ylim=(0, 1))
21axt.hist(data[0], color = '#5673E0', normed = True)
22
23#Bring the marginals closer to the scatter plot
24fig.tight_layout(pad = 1)
上記のコードは以下のサイトに載ってるものですが、参考にして調整すれば、片方だけヒストグラムを表示させることが可能だと思います。
http://cxhernandez.com/tutorials/dataviz/2014/11/19/jointplot-d3.html
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/01/29 16:20