1
$\begingroup$

I have read about Beeswarm and Histogram plots. But I did not understand the difference. In a Histogram, if the bins number is increased then its intrepretation is changed. So how can a beeswarm plot help to understand the data?

$\endgroup$
3
$\begingroup$

They are quite similar but :

  • Histograms results of aggregation into bins (loss of information due to aggregation: high-resolution point (2.324) is reduced to bins resolution [2,3])
  • Beeswarm plot displays the exact value of points on the axis. It is a 1D-scatter plot.

However, if two points are very close to each other they will overlap if the point size is big enough. To avoid this, the beeswarm plot will slightly shift one point to the side so it does not overlap.

They will often look similar because the more points you have locally, the higher the probability of overlapping. Then, high-density areas will often result in "peaks" as in histograms.

The beeswarm plot is a more faithful representation

enter image description here

  1. Gap in the data: depending on the binning (both placement and size), the histogram may not represent it (as on point 1 in the figure).
  2. Min and max: Imagine values are limited at 5 but the histogram last bins continues to 6, it might give the impression that the max value of the variable is 6.

In both cases, you can see that beeswarm is a more faithful representation.

Because of this, it is not highly scalable (it has to represent every single point with no overlap). On the seaborn.swarplot function docs :

This function is similar to stripplot(), but the points are adjusted (only along the categorical axis) so that they don’t overlap. This gives a better representation of the distribution of values, but it does not scale well to large numbers of observations. This style of plot is sometimes called a “beeswarm”.

$\endgroup$
6
  • $\begingroup$ Thanks for the answer , i have a one question more , is there also a plot which is better than beeswarm plot. $\endgroup$ – Satish Saini Apr 5 '20 at 3:52
  • $\begingroup$ I wouldn’t say one is better than the other. As mentionned histograms are suited when data volume increases and beeswarm is more suited with a small data volume to have a faithfull representation. You can also check violin plot (which is probably the easiest to understand for a non-scientific person) and boxplot (highly aggregated representation) $\endgroup$ – Rusoiba Apr 5 '20 at 7:03
  • $\begingroup$ Please accept my answer if answered your question :) $\endgroup$ – Rusoiba Apr 5 '20 at 7:11
  • $\begingroup$ I understand it . Thanks $\endgroup$ – Satish Saini Apr 6 '20 at 5:50
  • $\begingroup$ @Satish Saini please have a look on how to accept an answer $\endgroup$ – Bruno Lubascher Apr 17 '20 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.