Skip to content
Prev 105622 / 398503 Next

Show date on graph

Syed Abid Hussaini wrote:
Hi Syed,
If you try to display something with mtext, it expects the object to be 
a character string. When you just print the object, the print method 
works out that it is a date object and silently converts it to a 
character string to be printed. Try this:

mtext(format(date,"%Y-%m-%d"),...)

Also note that it isn't a great idea to use "date" to name a variable. 
Even though you can now get away with it, using the same name for two 
things (a function and a variable) often comes back to haunt one.

Jim