如果我理解正确的问题,你需要的是浮动的,你可以将作为您的情节注解轴。不幸的是,这是不是在matplotlib容易实现,因为据我所知。
一个简单的解决方案是将点和图形绘制在同一个轴上,并将图形缩小并靠近点。
import numpy as np
import scipy.stats as sps
import matplotlib.pyplot as plt
xp = [5, 1, 3]
yp = [2, 1, 4]
# just generate some curves
curves_x = np.array([np.linspace(0, 10, 100)] * 3)
curves_y = sps.gamma.pdf(curves_x[0], [[2], [5], [7]], 1)
plt.scatter(xp, yp, s=50)
for x, y, cx, cy in zip(xp, yp, curves_x, curves_y):
plt.plot(x + cy/np.max(cy) + 0.1 , y + cx/np.max(cx) - 0.5)
plt.show()
这是一个非常简单的例子。这些数字将不得不调整来寻找具有不同的数据的规模不错。