使用
scatter绘制图
PathCollection,因此x,y位置称为“偏移”:
import numpy as npimport matplotlib.pyplot as pltf, ax = plt.subplots()scat = ax.scatter(np.random.randn(10), np.random.randn(10))print scat.get_offsets()[[-0.17477838 -0.47777312] [-0.97296068 -0.98685982] [-0.18880346 1.16780445] [-1.65280361 0.2182109 ] [ 0.92655599 -1.40315507] [-0.10468029 0.82269317] [-0.09516654 -0.80651275] [ 0.01400393 -1.1474178 ] [ 1.6800925 0.16243422] [-1.91496598 -2.12578586]]



