%pylab inline from beeswarm import * import numpy as np d1 = np.random.normal(size=100) beeswarm([d1], method="swarm"); beeswarm([d1], method="hex"); beeswarm([d1], method="center"); beeswarm([d1], method="square"); beeswarm(d1); beeswarm([d1, d1]); beeswarm([d1]*4); d2 = np.random.uniform(low=-5, high=0, size=100) beeswarm([d1,d1,d2], positions=[1,2, 5], labels=["test1","test2","test3"], col=["red","green","orange"]); beeswarm([d1,d2,d2], xlim=(-2,5), ylim=(-6,6)); beeswarm([d1,d2,d2], xlim=(-2,5)); fig = plt.figure() ax = fig.add_subplot(111) ax.set_xlim(left=-2, right=6) ax.set_ylim(bottom=-10, top=10) bs, ax = beeswarm([d1,d1,d2,d2], positions=[0,3,5,6], ax=ax, col=["red","orange","yellow"]); ax.set_xlabel("testing x") bs.head() beeswarm([]) beeswarm([d1], positions=[]) beeswarm([d1], method="dummy") beeswarm([d1], col=2) d1 = np.random.normal(size=100) d2 = np.random.normal(loc=1, size=100) d3 = np.random.normal(scale=2, size=100) d4 = np.random.uniform(low=-3, high=3, size=100) bs, ax = beeswarm([d1,d2,d3,d4], col=["red","orange","yellow"], labels=["N(0,1)", "N(1,1)", "N(0,2)","Unif(-3,3)"]) ax.set_xticklabels(["N(0,1)", "N(1,1)", "N(0,2)","Unif(-3,3)"], size=15); ax.set_yticklabels(np.arange(-4,7,2), size=15); plt.savefig("example.png")