View source: R/wrapper_rangeframe.R
geom_rangeframe_cr | R Documentation |
By default, geom_rangeframe
uses the range of the x
and y data to set the range for the axis frame. This function instead uses
the provided xlim
and ylim
to create a data frame to provide new limits
to the range frame.
geom_rangeframe_cr(xlim, ylim, ...)
xlim |
Vector of length 2, gives the minimum and maximum values for the range frame on the x axis |
ylim |
Vector of length 2, gives the minimum and maximum values for the range frame on the y axis |
... |
Additional parameters for |
Just like geom_rangeframe
, this should be
used with coord_cartesian(clip="off")
in order to correctly draw the
lines.
library(ggplot2)
library(ggthemes)
df <- data.frame(x = 1:5, y = 1:5, z = c("a","b","c","b","c"))
p <- ggplot(df, aes(x, y, color = z)) + geom_point()
p + geom_rangeframe_cr(xlim = c(0,6), ylim = c(1,6), colour = "gray20")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.