|
From: Ethan A M. <sf...@us...> - 2015-09-15 19:56:18
|
On Tuesday, 15 September, 2015 18:16:53 Tait wrote: > > I find the implementation in R to be confusing. There are several > "types" of jitter, which appear to confound jitter in two > dimensions. JMP also offers jitter, if you want another > implementation to look at for a constrasting approach. I have not looked at the JMP code, but the appearance of the example http://www.jmp.com/support/help/images/students.gif looks similar to what my previous attempt at jitter code produced by replacing x = x + scale*rand(0) for all points. I found those random jitter plots to be ugly so I never pursued it. I find the beeswarm plots to be much nicer visually and they also convey more information. In particular they have the very nice property that as the number of points becomes large and the point size becomes small the result converges to a violin plot rather than to a solid rectangle. I.e. the envelope of the distribution remains informative, whereas random jitter conveys no information about the distribution once the points get dense enough to saturate the allowed width. I did not find a rigorous description of what the R package is doing, but the results I get are sufficiently similar in appearance that I guess they are doing something very like what my code does. > Jitter means applying a "small" (definition of which is open to > debate) offset to the specified dimension of a data set. I have > implemented it before within the "... using ..." directive to plot, > and that is where I believe it makes the most sense, e.g. > plot 'data.dat' using (jitter($1)):2 > As used this way, the jitter offsets don't alter the non-jittered > dimension, which the R examples appear to do. That confused me at first also, but it turns out that the visual appearance of the "bee swarm" plots is a result of applying a pure x displacement sequentially to points that have been sorted on y. The jitter is applied only to points that would otherwise overlap. Since successive points have a larger sorted y value and also receive a larger +/- x displacement, you get the upward-sweeping lines of points that are so distinctive. The opposite is true for the "square" option. Although at first glance it looks like this results from applying no displacement on y, in fact the only reason the displaced points line up in horizontal layers is that a y displacement is added to remove the incremental y from successive overlapping points. If the y values are discrete rather than continuous and their separation is greater than the overlap criterion, then both the swarm and square modes produce the same result. > The extension to higher-dimension plots seems straightforward. One > might jitter in x AND y, or in u and t, Sure. I was just wondering if anyone had an example of real-world data that would benefit from this form of display. The only thing I could think of was displaying the energy spread of individual photons striking a 2D pixel array, but I'm not sure that such an energy-sensitive pixel device actually exists. >or jitter the size and/or color with "ps variable" or "lc variable". When would that ever be useful? Spatial jitter removes overlap so that you can see how many points there are. What would perturbing the color or size accomplish? Ethan > > > ... > > http://www.cbs.dtu.dk/~eklund/beeswarm/ > > ... > > Syntax: > > set jitter {overlap <yposition>} {spread <factor>} {wrap <limit>} > > {swarm|square} > > ... > > Would it make sense to apply the jitter to other plot styles > > in addition to "with points"? > > Is there a logical 3D counterpart? |