From: Allin C. <cot...@wf...> - 2020-10-15 19:56:31
|
On Thu, 15 Oct 2020, Ethan A Merritt wrote: > On Thursday, 15 October 2020 08:02:27 PDT Allin Cottrell wrote: >> Maybe I'm missing something, but isn't the documentation for >> "jitter" backwards with respect to the swarm/square choice? >> >> The text reads thus: "The default jittering operation displaces >> points only along x. This produces a distinctive pattern sometimes >> called a "bee swarm plot". The optional keyword square adjusts the y >> coordinate of displaced points in addition to their x coordinate so >> that the points lie in distinct layers..." > > The text is correct as written. Perhaps the attached figure, > combining two plots from jitter.dem, will clarify. > > Left panel: > original data, randomly distributed on y, all x values the same > Center panel: > "beeswarm" result from displacing points along x > if they would otherwise overlap. > Points are still randomly distributed on y. > Right panel: > "square" plot uses the x displacements that would > generate a beeswarm plot, and adds an y displacement > that is effectively a floor(y) operation where the unit of > the floor operation is the "overlap" parameter to jitter. > >> >> In the demo and in my own usage it seems the default is in fact to >> displace in both the x and y dimensions while "square" limits the >> scatter to the x dimension. (Except that in some cases I'm not >> getting any y displacement with either choice, but that's another >> issue.) Thanks, Ethan. I think I get it now. But this is potentially quite confusing -- to understand exactly what jitter is doing one really has to look closely at the y data in numerical form. So 'swarm' preserves the original y values and just shoves points sideways to get them off each other, while 'square' will also regularize the y values to get the points into straight rows (more or less). And then, given a pile-up of data points at some discrete {x,y} value, there's no option to nudge them apart in both dimensions to form a cloud? I had the idea that was what "bee swarm" was about, but I guess I was mistaken. -- Allin Cottrell Department of Economics Wake Forest University |