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

2010-04-24 Thread Jun Shen
Hi, I also want to show user's name at the lower-left corner. So I added one more line to Deepayan's code but it didn't work. I am not sure how to use the page argument here. Appreciate any comment. lattice.options(default.args = list(page = function(n) { panel.text(lab = sprintf(%s, date()),

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

2010-04-24 Thread David Winsemius
On Apr 24, 2010, at 4:52 PM, Jun Shen wrote: Hi, I also want to show user's name at the lower-left corner. So I added one more line to Deepayan's code but it didn't work. I am not sure how to use the page argument here. Appreciate any comment. lattice.options(default.args = list(page =

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

2010-04-24 Thread Jun Shen
Hi, David, Thanks. It is working perfectly now. But I still don't understand the argument page, I couldn't find it in text() or par(). Also in the page = function(n){..} the argument n does not appear anywhere and it seems OK to be replaced with any other letter. Can anyone explain it a

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

2010-04-24 Thread David Winsemius
On Apr 24, 2010, at 6:26 PM, Jun Shen wrote: Hi, David, Thanks. It is working perfectly now. But I still don't understand the argument page, I couldn't find it in text() or par(). text and par are base graphics functions. page is an argument to lattice functions: (Page 26 of

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

2010-04-24 Thread David Winsemius
On Apr 24, 2010, at 9:00 PM, David Winsemius wrote: On Apr 24, 2010, at 6:26 PM, Jun Shen wrote: Hi, David, Thanks. It is working perfectly now. But I still don't understand the argument page, I couldn't find it in text() or par(). text and par are base graphics functions. page is an

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

2010-04-24 Thread Deepayan Sarkar
On Sat, Apr 24, 2010 at 3:26 PM, Jun Shen jun.shen...@gmail.com wrote: Hi, David, Thanks. It is working perfectly now. But I still don't understand the argument page, I couldn't find it in text() or par(). Also in the page = function(n){..} the argument n does not appear anywhere and it

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

2010-04-23 Thread Deepayan Sarkar
On Wed, Apr 21, 2010 at 4:02 PM, David Winsemius dwinsem...@comcast.net wrote: On Apr 21, 2010, at 6:58 PM, David Winsemius wrote: Sarkar offers a worked example of taking user input regarding location for locating a grid viewport outside the plot area.

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

2010-04-23 Thread David Winsemius
On Apr 23, 2010, at 11:32 AM, Deepayan Sarkar wrote: On Wed, Apr 21, 2010 at 4:02 PM, David Winsemius dwinsem...@comcast.net wrote: snipped earlier code Furthermore when I try: mtext(date(), side=3, line=4, adj=0) I get a datetime stamp even though I am mixing graphic

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

2010-04-23 Thread Jun Shen
Hi, Deepayan, This is exactly what I want. However I couldn't find page argument or default.args when I look up the documentation. I just want to learn a bit more how to use these arguments. Thanks again. Jun On Fri, Apr 23, 2010 at 10:32 AM, Deepayan Sarkar deepayan.sar...@gmail.com wrote:

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

2010-04-22 Thread Kevin Wright
Jun, I created a function called pageNum that does exactly what you want for both 'base' and 'lattice' graphics. You can find it here: http://ryouready.wordpress.com/2009/02/17/r-good-practice-adding-footnotes-to-graphics/ Kevin On Wed, Apr 21, 2010 at 7:23 PM, Jun Shen jun.shen...@gmail.com

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

2010-04-21 Thread Jun Shen
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. Jun [[alternative HTML version deleted]] __ R-help@r-project.org mailing

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

2010-04-21 Thread David Winsemius
On Apr 21, 2010, at 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. ?mtext Jun [[alternative HTML version deleted]]

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

2010-04-21 Thread Jun Shen
Thanks, David. mtext is for graphics. Is there an equivalent function for lattice? Jun On Wed, Apr 21, 2010 at 4:44 PM, David Winsemius dwinsem...@comcast.netwrote: On Apr 21, 2010, at 5:41 PM, Jun Shen wrote: Dear all, How do stamp my graphs with date and time somewhere like left

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

2010-04-21 Thread David Winsemius
Sarkar offers a worked example of taking user input regarding location for locating a grid viewport outside the plot area. http://lmdvr.r-forge.r-project.org/figures/figures.html See Figure 12.1 state - data.frame(state.x77, state.region) trellis.vpname(xlab, prefix = plot1)

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

2010-04-21 Thread David Winsemius
On Apr 21, 2010, at 6:58 PM, David Winsemius wrote: Sarkar offers a worked example of taking user input regarding location for locating a grid viewport outside the plot area. http://lmdvr.r-forge.r-project.org/figures/figures.html See Figure 12.1 state - data.frame(state.x77,

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

2010-04-21 Thread Duncan Murdoch
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,

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

2010-04-21 Thread Jun Shen
David, Duncan, Thanks. I didn't realize the functions in graphic also work in lattice. I thought they didn't work with each other. Jun On Wed, Apr 21, 2010 at 6:51 PM, Duncan Murdoch murdoch.dun...@gmail.comwrote: On 21/04/2010 5:41 PM, Jun Shen wrote: Dear all, How do stamp my graphs