Before presenting the actual data, I would like to make a plot identical to the one with data but then without the data points in there. This helps me in explaining how to interpret such a plot without distracting the audience with the actual data that will be in the plot.
So in the code below I would basically want to exchange the geom_point() with geom_blank(). No problem.
However, this also removes the color and size information from the legends that the plot code creates. Is there a way to get this back?
ggplot(vas, aes(x=time, y=pain, colour=light.color, size=light.intensity)) +
#geom_point(na.rm=FALSE) +
geom_blank() +
facet_wrap(~ppno) +
scale_colour_manual(values=cols) +
scale_y_continuous(name="VAS Pain (a.u.)") +
scale_x_continuous(name="Time (minutes)")
What is proper way to get the color indications back into the legend(s). Now they only display the value(s) of the various levels of a certain parameter (colour or size) but not the actual graphical element (a color or a size of a dot) that goes with a certain level.
A simple way to do this would be to use the size option:
Could you plot two geom_points() - one with the color of your background?
In the end, taking Aniko's suggestion along (that I initially couldn't get to work, so discarded, unrightly so) I came up with the following code.
So it was about just shifting around your data on an axis and then excluding that part of
How about hiding the actual points outside the plotting window? Something along these lines: