Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
An example using manipulate to modify a ggplot object. Requires RStudio.
aPlotFunction <- function(hh, ss, sz){
zp1 <- qplot(data = cars, x = dist, y = speed,
colour = I(hsv(hh/255, 1, 1)),
shape = I(ss),
size = I(sz))
print(zp1 + theme_bw())
}
manipulate(
aPlotFunction(hh, ss, sz),
hh = slider(0, 255, step = 1, initial = 0),
ss = slider(1, 255, step = 1, initial = 1),
sz = slider(1, 20, step = 1, initial = 1))
@ZeccaLehn

This comment has been minimized.

Copy link

ZeccaLehn commented Aug 4, 2014

Excellent!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.