[R] Main title of plot

2006-07-26 Thread Marco Boks
I am a newbie, and I am afraid this may be a rather trivial question. However I 
could not find the answer anywhere.

 

I am plotting a series of plots with different values for p. In the main title 
of a plot I have used the following code:

 

 

plot(a,b,type=l,ylim=c(0,1), xlab=freq,ylab=power, main=c(maximum 
gain=,p) )

 

That works fine. However the value of p is plotted on a new line, instead of 
just after the =

 

Is there anyway to print the value of p on the same line?

 

Thanks 

 
Marco

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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.


Re: [R] Main title of plot

2006-07-26 Thread Gabor Grothendieck
This was just discussed yesterday.  See the thread:

https://www.stat.math.ethz.ch/pipermail/r-help/2006-July/109931.html

On 7/26/06, Marco Boks [EMAIL PROTECTED] wrote:
 I am a newbie, and I am afraid this may be a rather trivial question. However 
 I could not find the answer anywhere.



 I am plotting a series of plots with different values for p. In the main 
 title of a plot I have used the following code:





 plot(a,b,type=l,ylim=c(0,1), xlab=freq,ylab=power, main=c(maximum 
 gain=,p) )



 That works fine. However the value of p is plotted on a new line, instead of 
 just after the =



 Is there anyway to print the value of p on the same line?



 Thanks


 Marco

[[alternative HTML version deleted]]

 __
 R-help@stat.math.ethz.ch 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.


__
R-help@stat.math.ethz.ch 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.


Re: [R] Main title of plot

2006-07-26 Thread Marc Schwartz
Gabor,

I think that this is actually different, since it does not involve
plotmath.

The issue here is the use of c() in:

  main=c(maximum gain=,p)

rather than:

  main = paste(maximum gain =, p)

Marco, try this:

plot(a, b, type=l, ylim=c(0, 1), xlab = freq, ylab = power,
 main = paste(maximum gain =,p))

See ?paste for concatenating multiple vectors into a single character
vector (string).

HTH,

Marc Schwartz



On Wed, 2006-07-26 at 07:29 -0400, Gabor Grothendieck wrote:
 This was just discussed yesterday.  See the thread:
 
 https://www.stat.math.ethz.ch/pipermail/r-help/2006-July/109931.html
 
 On 7/26/06, Marco Boks [EMAIL PROTECTED] wrote:
  I am a newbie, and I am afraid this may be a rather trivial
 question. However I could not find the answer anywhere.
 
 
 
  I am plotting a series of plots with different values for p. In the
 main title of a plot I have used the following code:
 
 
 
 
 
  plot(a,b,type=l,ylim=c(0,1), xlab=freq,ylab=power,
 main=c(maximum gain=,p) )
 
 
 
  That works fine. However the value of p is plotted on a new line,
 instead of just after the =
 
 
 
  Is there anyway to print the value of p on the same line?
 
 
 
  Thanks
 
 
  Marco
 

__
R-help@stat.math.ethz.ch 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.