grid | R Documentation |
Adds grid lines to the plot background. See grid
for more details.
grid(object, ...)
object |
gsplot object |
... |
Further graphical parameters may also be supplied as arguments |
grid
gs <- gsplot()
gsNew <- points(gs, y=1, x=2, xlim=c(0,NA),ylim=c(0,NA),
col="blue", pch=18, legend.name="Points")
gsNew <- lines(gsNew, c(3,4,3), c(2,4,6), legend.name="Lines")
gsNew <- grid(gsNew)
gsNew <- abline(gsNew, b=1, a=0, legend.name="1:1")
gsNew <- legend(gsNew, location="topleft",title="Awesome!")
gsNew
x.date <- seq(as.Date("2000-01-01"), by = "month", length.out = 10)
gs <- gsplot() %>%
points(x.date,1:10) %>%
lines(6:14,6:14,side=c(3,4)) %>%
grid(side=c(3,4))
gs
gs <- gsplot() %>%
points(1:10,1:10) %>%
axis(side=1, at=seq(1,10,length.out=18),las=3) %>%
axis(side=3, labels=FALSE) %>%
grid(side=c(1,2),col="green") %>%
grid(side=c(3,4))
gs
gs <- gsplot() %>%
points(x=seq.Date(as.Date("2000-01-01"),as.Date("2010-01-01"),length.out = 20),
y=1:20,axes=FALSE) %>%
grid()
gs
gs <- gsplot() %>%
points(x=1:10, y=1:10) %>%
grid(lty=3, col="gray") %>%
axis(side=2, reverse=TRUE)
gs
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.