python双重直方图_Python – 使用散点图堆叠两个直方图

有一个散点图的示例代码及其直方图x = np.random.rand(5000,1)y = np.random.rand(5000,1)fig = plt.figure(figsize=(7,7))ax = fig.add_subplot(111)ax.scatter(x, y, facecolors='none')ax.set_xlim(0,1)ax.set_ylim(0,1)fig1 = pl...
摘要由CSDN通过智能技术生成

有一个散点图的示例代码及其直方图

x = np.random.rand(5000,1)

y = np.random.rand(5000,1)

fig = plt.figure(figsize=(7,7))

ax = fig.add_subplot(111)

ax.scatter(x, y, facecolors='none')

ax.set_xlim(0,1)

ax.set_ylim(0,1)

fig1 = plt.figure(figsize=(7,7))

ax1 = fig1.add_subplot(111)

ax1.hist(x, bins=25, fill = None, facecolor='none',

edgecolor='black', linewidth = 1)

fig2 = plt.figure(figsize=(7,7))

ax2 = fig2.add_subplot(111)

ax2.hist(y, bins=25 , fill = None, facecolor='none',

edgecolor='black', linewidth = 1)

我想要做的是创建这个图形,直方图附加到他们尊重的轴上,就像这个例子一样

919df3295acb129cd5934ec98e6afefa.png

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值