Dear R Users, I'm finding that when I execute the following bit of code, that the new line argument is actually displayed as text in the graphics device. How do I avoid this happening? mtext(side=2, line=5.5, expression(paste("Monthly Summed Runoff (mm/month)", "/n", "and Summed Monthly Precipitation (mm x ",10^2,"/month)"))) I suspect that I've done, or omitted, something fairly obvious, but as yet cannot see it! Thanks for your help, Steve
Steve Murray wrote:> Dear R Users, > > I'm finding that when I execute the following bit of code, that the new line argument is actually displayed as text in the graphics device. How do I avoid this happening? > > mtext(side=2, line=5.5, expression(paste("Monthly Summed Runoff (mm/month)", "/n", "and Summed Monthly Precipitation (mm x ",10^2,"/month)")))use "\n" rather than "/n" Uwe Ligges> > I suspect that I've done, or omitted, something fairly obvious, but as yet cannot see it! > > Thanks for your help, > > Steve > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
On 6/22/2009 10:30 AM, Steve Murray wrote:> Thanks again for a very useful comment. That seems to have separated the text and put it onto separate lines. > > However, whilst this results in the text being centralised in relation to the axis, it means that the lower line is left-justified in relation to the upper line, rather than being centralised. > > How do I go about centralising the lower line in relation to the upper line, whilst keeping it central to the axis?I think two calls to mtext, one for each line, should do it. Duncan Murdoch