-
-
Notifications
You must be signed in to change notification settings - Fork 38
Jitter options & parameters (for plotting points) #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When >0, parameters `x-jitter`, `y-jitter`, and `z-jitter` will add random noise to each point along the specified dimension. New points lie within a rectangle with width `x-jitter`, height `y-jitter`, and depth `z-jitter` centered at each point's original location, but kept within the bounds for x-min, x-max, etc. given to `points` or `points3d`.
@@ -51,6 +54,10 @@ For example, a scatter plot of points sampled uniformly from the surface of a sp | |||
|
|||
(plot3d (points3d (map vector xs ys zs) #:sym 'dot) | |||
#:altitude 25)] | |||
|
|||
When @(racket x-jitter), @(racket y-jitter), or @(racket z-jitter) is non-zero, | |||
each point @(racket p) is translated to a random location inside a rectangle centered at @(racket p) with width @(racket x-jitter), height @(racket y-jitter), and depth @(racket z-jitter). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/rectangle/box/ ?
I think the docs should mention/discuss use cases. Otherwise, it's not clear when one might want this. |
Good points, thanks |
This blog post has a nice example of jitter use: http://kieranhealy.org/blog/archives/2015/02/03/another-look-at-the-california-vaccination-data/ |
Should I add a margin note for this? (and maybe, Typing with Pleasure) |
Sounds like a good idea. |
Removed the extreme caution & added the external links. |
LGTM |
Jitter options & parameters (for plotting points)
New optional arguments for
points
andpoints3d
, and new parameters to match.When
> 0
, parametersx-jitter
,y-jitter
, andz-jitter
will add random noise to each point along the specified dimension.New points lie within a rectangle with width
x-jitter
, heighty-jitter
, and depthz-jitter
centered at each point's original location, but kept within the bounds for x-min, x-max, etc. given topoints
orpoints3d
.Inspired by R's ggplot2. I think this is a nice substitute for boxplots and violin plots.
Example: