I have read the question Matplotlib: avoiding overlapping datapoints in a "scatter/dot/beeswarm" plot and the question Adding a scatter of points to a boxplot using matplotlib however I would like to generate plots like these generated with R:
(source: eklund at www.cbs.dtu.dk)
Here is the code used for those figures.
I would like to do it with matplotlib but so far I have only managed to use np.random.normal(i, 0.05)
. The dots separate from each other, but I'd like to have them ordered.
This answer does something similar to what I want but my data are float numbers which are very close but are different, therefore the groupby
function does not work, and I'd like to have the dots symmetric to the center as shown in the plots generated with R shown above.