Description Usage Arguments Value Note Author(s) See Also Examples
A layer with gray background and white grid lines corresponding to axis tick marks. Minor grid lines are optional and thinner.
1 |
parent |
the parent layer (default to be |
meta |
|
xat |
locations to draw vertical grid lines |
yat |
locations to draw horizontal grid lines |
xlim |
the x-axis limits ( |
ylim |
the y-axis limits ( |
minor |
defines which minor lines to draw: |
... |
other arguments passed to |
a layer object
If meta
is not NULL
, it is supposed to be a
reference object, and an event will be attached on
meta$limits
so that the limits of the grid layer will sync
with meta$limits
dynamically.
Yihui Xie <http://yihui.name>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | library(cranvas)
library(qtbase)
library(qtpaint)
s <- qscene()
r <- qlayer(s)
l <- qrect(matrix(c(0, 1, 0, 1), 2))
m <- qlayer(paintFun = function(layer, painter) {
qdrawCircle(painter, runif(1000), runif(1000), r = 2)
qdrawRect(painter, 0, 0, 1, 1)
}, limits = l) # main layer
g <- qgrid(xat = seq(0, 1, 0.2), yat = seq(0, 1, 0.5), xlim = c(0, 1), ylim = c(0,
1), limits = l)
r[1, 1] <- g # must add the grid layer FIRST, then the plot layer
r[1, 1] <- m
print(qplotView(scene = s))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.