【发布时间】:2019-11-26 13:21:18
【问题描述】:
我有 3 个散点图,想知道如何将这 3 个组合成 1 个大散点图。
我似乎无法仅使用 Matplotlib 找到解决此特定问题的方法。
x1 = np.random.randint(40, 100, 50)
y1 = np.random.randint(40, 100, 50)
x2 = np.random.randint(0, 60, 50)
y2 = np.random.randint(0, 60, 50)
x3 = np.random.randint(40, 100, 50)
y3 = np.random.randint(0, 60, 50)
fig, (plot1, plot2, plot3, plot4) = plt.subplots(1, 4)
plot1.scatter(x1,y1, color='green', s = 10)
plot1.set(xlim=(0, 100), ylim=(0, 100))
plot2.scatter(x2,y2, color='red', s = 10)
plot2.set(xlim=(0, 100), ylim=(0, 100))
plot3.scatter(x3,y3, color='blue', s = 10)
plot3.set(xlim=(0, 100), ylim=(0, 100))
plot4.scatter(plot1, plot2, plot3)
所以我希望 plot4 是 plot1、plot2 和 plot3 的组合。
【问题讨论】:
标签: python matplotlib data-visualization scatter-plot