Description Usage Arguments Value Author(s) See Also Examples
R's svg
function,
based on libcairo, draws circles using
an SVG (cubic) Bezier path rather than
the <circle>
element.
This function allows us to change such a node to the
<circle>
representation.
1 | pathToCircle(path, box = getBoundingBox(path), force = FALSE, addTypes = TRUE)
|
path |
the |
box |
the bounding box of the input/source node being converted. This should be of class Circle. |
force |
a logical value. If the input node does not correspond to a circle, this controls whether we force the conversion anyway. |
addTypes |
a logical value indicating whether to add a
|
The new node or the existing one if it is not suitable for change!
Duncan Temple Lang
1 2 3 4 5 6 7 8 9 10 11 12 13 | doc = svgPlot(plot(1:10))
rr = getPlotRegionNodes(doc)
names(rr[[1]])
pathToCircle(rr[[1]][[1]])
names(rr[[1]])
as(getBoundingBox(rr[[1]]), "Circle")
pathToCircle(rr[[1]]) # silently leaves things unchanged
pathToCircle(rr[[1]], force = TRUE) # silently leaves things unchanged
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.