[R] mtext in the top left of margin

Hermann Norpois hnorpois at gmail.com
Wed Sep 16 12:00:02 CEST 2015


Hello,

for a multiple figures plot I am looking for the syntax to put text in the
top left of the margin (of the plot). I want my testfunction plot.figure to
place mtext in the top left of the red margin (created by box("figure",
col="red")).

Can anybody help?

Thanks
Hermann

plot.figure <- function ()
    {


        par (mfrow=c(3,1))
        par (mar=c(3,3,1,0.5))
        par (oma=c(1,1,1,1))
        par (mar=c(3,5,3,2))

        plot (dnorm, from=-4, to=4, main="Test")
        box ("plot", col="grey")
        box ("figure", col="red")
        box ("outer", col="blue")
        mtext ("A", side=3, adj=0, line=1.5)

        plot (dnorm, from=-4, to=4)
        box ("plot", col="grey")
        box ("figure", col="red")
        box ("outer", col="blue")
 mtext ("B", side=3, adj=0, line=1)
        plot (dnorm, from=-4, to=4)
        box ("plot", col="grey")
        box ("figure", col="red")
        box ("outer", col="blue")
mtext ("C", side=3, adj=0)
    }

	[[alternative HTML version deleted]]



More information about the R-help mailing list