[R] How to stamp my graphs with date and time

Duncan Murdoch murdoch.duncan at gmail.com
Thu Apr 22 01:51:46 CEST 2010


On 21/04/2010 5:41 PM, Jun Shen wrote:
> Dear all,
>
> How do stamp my graphs with date and time somewhere like left corner of the
> graph (not the plotting area). I know date() and Sys.time(), but where to?
> Thanks.
Use mtext() to put text onto a plot.  For example,

plot(1)
mtext(Sys.time(), side=1, line=4, at=par("usr")[1])

(You will need to play with the side=, line= and at= specifications to 
get the location you want.)

Duncan Murdoch



More information about the R-help mailing list