prepanel
, specify rules that will determine x and y axis limits to be passed as the lims
argument when calling makeDisplay
.
setLims(lims, x = "same", y = "same", xQuant = c(0, 1), yQuant = c(0, 1), xRangeQuant = 1, yRangeQuant = 1, prop = 0.07)
makeDisplay
About "x" and "y" parameters: This is the same as in lattice. From lattice documentation: A character string that determines how axis limits are calculated for each panel. Possible values are "same" (default), "free" and "sliced". For relation="same", the same limits, usually large enough to encompass all the data, are used for all the panels. For relation="free", limits for each panel is determined by just the points in that panel. Behavior for relation="sliced" is similar, except that the length (max - min) of the scales are constrained to remain the same across panels.
prepanel
, makeDisplay
## Not run:
# irisSplit <- datadr::divide(iris, "Species")
# irisPreFn <- function(x) {
# list(
# xlim = range(x$Sepal.Length),
# ylim = range(x$Sepal.Width)
# )
# }
# irisPre <- prepanel(irisSplit, prepanelFn = irisPreFn)
# irisLims <- setLims(irisPre, x = "same", y = "sliced")
# ## End(Not run)
d <- datadr::divide(iris, "Species")
irisPreFn <- function(x) {
list(
xlim = range(x$Sepal.Length),
ylim = range(x$Sepal.Width)
)
}
irisPre <- prepanel(d, prepanelFn = irisPreFn)
plot(irisPre)
irisLims <- setLims(irisPre, x = "same", y = "sliced")
Run the code above in your browser using DataLab