mtext | R Documentation |
Allows text to be added to the plot margins. See mtext
for more details.
mtext(object, ...)
object |
gsplot object |
... |
Further graphical parameters may also be supplied as arguments. See 'Details'. |
Additional graphical parameter inputs:
text
character string specifying the text to be placed in the margins
side
numeric, specifies the side of the graph to place the text - bottom(1), left(2), top(3), or right(4)
line
numeric, specifies the distance from the plot to place the text (in 'number of text lines')
mtext
gs <- gsplot()
gsNew <- points(gs, y=1, x=2, col="blue", pch=18, legend.name="Points")
gsNew <- lines(gsNew, c(3,4,3), c(2,4,6), legend.name="Lines", ylab="Data!")
gsNew <- text(gsNew, x=3.5, y=1.5, labels="Test")
gsNew <- abline(gsNew, b=1, a=0, legend.name="1:1")
gsNew <- legend(gsNew, location="topleft",title="Awesome!")
gsNew <- title(gsNew, main="Great Graph")
gsNew <- mtext(gsNew, text="More Stuff", side=2, line=3)
gsNew
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.