<?xml version="1.0"?>
<doc xmlns:r="http://www.r-project.org">
  <section id="mtcars">
    <para>  Link points in two plots </para>
    <r:code id="SVGMTCarsLinkPlotsAll">
library(SVGAnnotation)

doc = svgPlot({ par(mfrow = c(1, 2))
  plot(mpg ~ wt, mtcars, main="MPG", ylab="", cex = 1.4)
  plot(hp ~ wt, mtcars, main = "Horsepower", ylab="", cex = 1.4)
})

linkPlots(doc)
saveXML(doc, "../mt_link.svg")
</r:code>
  </section>
  <section id="arrests">
    <r:code id="SVGArrestsInitialPlots">
doc = svgPlot({par(mfrow = c(1,2))
    plot(Murder ~ UrbanPop, USArrests, main="", cex = 1.4)
    plot(Rape ~ UrbanPop, USArrests, main = "", cex = 1.4)
    }, 
  width = 14, height = 7)
</r:code>
    <r:code id="SVGArrestsLinkAndSave">
linkPlots(doc)
saveXML(doc, "USArrests_linked.svg")
</r:code>
  </section>
</doc>
