# NOT RUN {
if(interactive()){
# Source and target are `l_plots`
p <- with(iris,
l_plot(x = Sepal.Width, y = Petal.Width,
color = Species, glyph = "ccircle",
size = 10, showGuides = TRUE,
title = "Edgar Anderson's Iris data"
)
)
p2 <- with(iris,
l_plot(x = Sepal.Length, y = Petal.Length,
title = "Fisher's Iris data"
)
)
# Copy the states of p to p2
# First just the size and title
l_copyStates(source = p, target = p2,
states = c("size", "title")
)
# Copy all but those associated with the variables
l_copyStates(source = p, target = p2)
# Suppose p had a linkingGroup, say "Edgar"
l_configure(p, linkingGroup = "Edgar", sync = "push")
# To force this linkingGroup to be copied to a new plot
p3 <- with(iris,
l_plot(x = Sepal.Length, y = Petal.Length,
title = "Fisher's Iris data"
)
)
l_copyStates(source = p, target = p3,
states = c("linkingGroup"),
# To allow this to happen:
excludeBasicStates = FALSE
)
h <- with(iris,
l_hist((Petal.Width * Petal.Length),
showStackedColors = TRUE,
yshows = "density")
)
l_copyStates(source = p, target = h)
sa <- l_serialaxes(iris, axes = "parallel")
l_copyStates(p, sa)
pp <- l_pairs(iris, showHistograms = TRUE)
l_copyStates(p, pp) # makes no copy (not one to one)
pp2 <- l_pairs(iris,
color = iris$Species,
showGuides = TRUE,
title ="Iris data",
glyph = "ctriangle")
l_copyStates(pp2, pp)
l_copyStates(pp2, p)
}
# }
Run the code above in your browser using DataLab