Thus, + geom_line(...) + geom_point(...) plots the points on top of
the lines, and + geom_point(...) + geom_line(...) plots the lines on
top of the points. So I can control this by reordering the clauses.
How do I control the ordering within the geom? It appears that
geom_point plots left-to-right, bottom-to-top, but what I would like
to do is to specify which values plot on top of which others. The
typical case is that I have a scatterplot where I'm using color for
the third dimension, but in places where the dots are dense, I can't
see the rare case that I'm trying to pick out with color. I suppose I
could divide the data into multiple classes, and do something like
+ geom_point( data = df[df$z<1,], ...) + geom_point (data =
df[df$z >= 1 | df$z < 2, ], ...) + ...
but that is obviously pretty messy.
Is there some way to control this with a z-variable? What controls
the current ordering? Is it in a modifiable position_ clause or
something?
Thanks,
-s
You can use the order aesthetic. I haven't publicised it because it's
a bit buggy, but I'm pretty sure it works (at least) for points and
lines.
Hadley