Re: [R] title of r plots

2015-02-28 Thread William Dunlap
Use help(plotmath) to see all the details - you can use tildes for spaces,
asterisks for no spaces.

Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Fri, Feb 27, 2015 at 8:52 PM, li li hannah@gmail.com wrote:


 Thanks very much.
 Also How do add an empty space when using expression()?
 When I do the following, it returns an error message.


 plot(1,1,main=expression(-70*degree*C%+-%10*degree*C/Ambient Condition))



Hanna


 2015-02-27 23:03 GMT-05:00 William Dunlap wdun...@tibco.com:

  plot(1,1,main=expression(-70*degree*C%+-%10*degree*C/Ambient))

  Bill Dunlap
 TIBCO Software
 wdunlap tibco.com

  On Fri, Feb 27, 2015 at 7:27 PM, li li hannah@gmail.com wrote:

   Hi all,
   I would like to add -70°C ± 10°C/Ambient  as the title of my plot.
 Could anyone give some help on this?
   Thanks.
Hanna

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 http://www.r-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.





[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] title of r plots

2015-02-27 Thread William Dunlap
 plot(1,1,main=expression(-70*degree*C%+-%10*degree*C/Ambient))

Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Fri, Feb 27, 2015 at 7:27 PM, li li hannah@gmail.com wrote:

  Hi all,
   I would like to add -70°C ± 10°C/Ambient  as the title of my plot.
 Could anyone give some help on this?
   Thanks.
Hanna

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 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.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] title of r plots

2015-02-27 Thread li li
 Hi all,
  I would like to add -70°C ± 10°C/Ambient  as the title of my plot.
Could anyone give some help on this?
  Thanks.
   Hanna

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] title of r plots

2015-02-27 Thread li li
Thanks very much.
Also How do add an empty space when using expression()?
When I do the following, it returns an error message.


plot(1,1,main=expression(-70*degree*C%+-%10*degree*C/Ambient Condition))



   Hanna


2015-02-27 23:03 GMT-05:00 William Dunlap wdun...@tibco.com:

  plot(1,1,main=expression(-70*degree*C%+-%10*degree*C/Ambient))

  Bill Dunlap
 TIBCO Software
 wdunlap tibco.com

  On Fri, Feb 27, 2015 at 7:27 PM, li li hannah@gmail.com wrote:

   Hi all,
   I would like to add -70°C ± 10°C/Ambient  as the title of my plot.
 Could anyone give some help on this?
   Thanks.
Hanna

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 http://www.r-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] title size problem

2014-06-18 Thread carol white
Hi,
When I use any value greater than 2 for cex.main in title, I get 


 title(myTitle, cex.main= 5)
Error in title(myTitle, cex.main = 5) : 
  X11 font -adobe-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*, face 2 at size 60 could 
not be loaded


How to fix it?

Thanks

Carol

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] title size problem

2014-06-18 Thread Prof Brian Ripley

On 18/06/2014 08:14, carol white wrote:

Hi,
When I use any value greater than 2 for cex.main in title, I get


  title(myTitle, cex.main= 5)
Error in title(myTitle, cex.main = 5) :
   X11 font -adobe-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*, face 2 at size 60 
could not be loaded


How to fix it?


Install the appropriate fonts.

Given that you have ignored the request for 'at a minimum information' 
in the posting guide and not even told us what device you are using, we 
cannot help in more detail.


[Clearly this is a version of the X11() device, but there are two and 
how one of those does font selection varies between OS X and other 
Unix-alikes.  As a guess you are not using a cairographics-based device, 
and should be.  See capabilities(cairo).]




Thanks

Carol

[[alternative HTML version deleted]]



__
R-help@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.


PLEASE do!

--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@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.


Re: [R] Title for a group of plots?

2011-11-11 Thread Uwe Ligges


Or even simpler (unbelievable!), see ?title:


par(mfcol=c(2,2), oma=c(0,0,1,0))
replicate(4, plot(1))
title(Hello World!, outer=TRUE)

Best,
Uwe Ligges



On 10.11.2011 17:13, Sarah Goslee wrote:

Try ?mtext for information on how to plot into the outer margin of a group of
plots.

Sarah

On Thu, Nov 10, 2011 at 11:07 AM, Kevin Burtonrkevinbur...@charter.net  wrote:

I can get multiple plots on a page like:



op- par(mfcol = c(3, 1))



What I was wondering is if there is a way to have a title for the whole
page? I can specify the title for each individual plot like:



plot(xxx, main=.)



But I would like a 'title' for the group of plots. Is this possible?



Thank you.



Kevin







__
R-help@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.


[R] Title for a group of plots?

2011-11-10 Thread Kevin Burton
I can get multiple plots on a page like:

 

op - par(mfcol = c(3, 1))

 

What I was wondering is if there is a way to have a title for the whole
page? I can specify the title for each individual plot like:

 

plot(xxx, main=.)

 

But I would like a 'title' for the group of plots. Is this possible?

 

Thank you.

 

Kevin


[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Title for a group of plots?

2011-11-10 Thread Bert Gunter
?mtext
(Note the outer argument)

-- Bert



On Thu, Nov 10, 2011 at 8:07 AM, Kevin Burton rkevinbur...@charter.netwrote:

 I can get multiple plots on a page like:



 op - par(mfcol = c(3, 1))



 What I was wondering is if there is a way to have a title for the whole
 page? I can specify the title for each individual plot like:



 plot(xxx, main=.)



 But I would like a 'title' for the group of plots. Is this possible?



 Thank you.



 Kevin


[[alternative HTML version deleted]]

 __
 R-help@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.




-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Title for a group of plots?

2011-11-10 Thread Sarah Goslee
Try ?mtext for information on how to plot into the outer margin of a group of
plots.

Sarah

On Thu, Nov 10, 2011 at 11:07 AM, Kevin Burton rkevinbur...@charter.net wrote:
 I can get multiple plots on a page like:



 op - par(mfcol = c(3, 1))



 What I was wondering is if there is a way to have a title for the whole
 page? I can specify the title for each individual plot like:



 plot(xxx, main=.)



 But I would like a 'title' for the group of plots. Is this possible?



 Thank you.



 Kevin




-- 
Sarah Goslee
http://www.functionaldiversity.org

__
R-help@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.


Re: [R] Title for a group of plots?

2011-11-10 Thread Muhammad Rahiz

Perhaps something like this?

par(oma=c(0,0,2,0))
par(mar=c(1,1,1,1))
par(mfcol=c(3,1))

plot(rnorm(10))
mtext(title)
plot(rnorm(10))
plot(rnorm(10))


--
Muhammad Rahiz

On Thu, 10 Nov 2011, Kevin Burton wrote:


I can get multiple plots on a page like:



op - par(mfcol = c(3, 1))



What I was wondering is if there is a way to have a title for the whole
page? I can specify the title for each individual plot like:



plot(xxx, main=.)



But I would like a 'title' for the group of plots. Is this possible?



Thank you.



Kevin


[[alternative HTML version deleted]]

__
R-help@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.



__
R-help@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.


[R] Title

2011-02-08 Thread kateF87

I have a relatively simple question. 

I am trying to post a title to a plot using a symbol and multiple lines.
Right now I have:

title(main = c('Hazard Ratio for women with score', expression('='),
'Across /nQuintiles of Activity')

Thanks in advance
-- 
View this message in context: 
http://r.789695.n4.nabble.com/Title-tp3276281p3276281.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.


Re: [R] Title

2011-02-08 Thread David Winsemius


On Feb 8, 2011, at 11:43 AM, kateF87 wrote:



I have a relatively simple question.

I am trying to post a title to a plot using a symbol and multiple  
lines.

Right now I have:

title(main = c('Hazard Ratio for women with score', expression('='),
'Across /nQuintiles of Activity')


I am going to anticipate the next question, which I assume to be how  
to insert a value after the = sign:


 b=5
 plot(1,1)
 title(main = bquote(atop(paste(Hazard Ratio for women with score,  
=.(b)) , Across Quintiles of Activity) ) )


--
David Winsemius, MD
West Hartford, CT

__
R-help@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.


Re: [R] Title

2011-02-08 Thread David Winsemius


On Feb 8, 2011, at 12:25 PM, David Winsemius wrote:



On Feb 8, 2011, at 11:43 AM, kateF87 wrote:



I have a relatively simple question.

I am trying to post a title to a plot using a symbol and multiple  
lines.

Right now I have:

title(main = c('Hazard Ratio for women with score', expression('='),
'Across /nQuintiles of Activity')


I am going to anticipate the next question, which I assume to be how  
to insert a value after the = sign:


 b=5
 plot(1,1)
 title(main = bquote(atop(paste(Hazard Ratio for women with  
score, =.(b)) , Across Quintiles of Activity) ) )



Even more compact (paste not needed) would be:

title(main = bquote(atop(Hazard Ratio for women with score=.(b) ,  
Across Quintiles of Activity) ) )

--
David Winsemius, MD
West Hartford, CT

__
R-help@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.


David Winsemius, MD
West Hartford, CT

__
R-help@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.


Re: [R] Title

2011-02-08 Thread David Scott

On 9/02/2011 6:25 a.m., David Winsemius wrote:


On Feb 8, 2011, at 11:43 AM, kateF87 wrote:



I have a relatively simple question.

I am trying to post a title to a plot using a symbol and multiple
lines.
Right now I have:

title(main = c('Hazard Ratio for women with score', expression('='),
'Across /nQuintiles of Activity')


I am going to anticipate the next question, which I assume to be how
to insert a value after the = sign:

b=5
plot(1,1)
title(main = bquote(atop(paste(Hazard Ratio for women with score,
=.(b)) , Across Quintiles of Activity) ) )



Wow, where did you get that idea from! In my mind atop had always been 
for use in such things as the expression for a combination, basically a 
fraction without the dividing line between numerator and denominator. To 
use it to put whole lines of text on top of each other is ... creative!


I was going to offer the conventional advice which is to use mtext 
because of the restriction in plotmath that \n is not allowed:


Control characters (e.g. \n) are not interpreted in character strings 
in plotmath, unlike normal plotting.


But atop works as you suggest. A very useful trick, because mtext with 
multiple lines can take time to get right. It does offer a bit more 
control over line spacing which could be a concern with atop.


David Scott





--
_
David Scott Department of Statistics
The University of Auckland, PB 92019
Auckland 1142,NEW ZEALAND
Phone: +64 9 923 5055, or +64 9 373 7599 ext 85055
Email:  d.sc...@auckland.ac.nz,  Fax: +64 9 373 7018

Director of Consulting, Department of Statistics

__
R-help@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.


Re: [R] Title for y-axis on right side

2010-12-19 Thread Jim Lemon

On 12/17/2010 10:41 PM, phils_mu...@arcor.de wrote:

Hi,

I want to have a title for the y-axis on the right side of the plot.
I know how to do it on the left side:


title(ylab=Title for y-axis)


But how can I have the title on the right side?


Hi Phil,
You probably want to add some margin on the right before you do the plot:

par(mar=c(5,4,4,4))
plot(...)

then:

mtext(Right side,side=4,line=2)

Jim

__
R-help@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.


[R] Title for y-axis on right side

2010-12-17 Thread phils_muell
Hi,

I want to have a title for the y-axis on the right side of the plot.
I know how to do it on the left side:

 title(ylab=Title for y-axis)

But how can I have the title on the right side?

Greets,
Phil

__
R-help@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.


Re: [R] Title for y-axis on right side

2010-12-17 Thread Andrew Miles
Take a look at mtext() which offers options for writing text in any  
margin of the table.


Andrew Miles

On Dec 17, 2010, at 6:41 AM, phils_mu...@arcor.de wrote:


Hi,

I want to have a title for the y-axis on the right side of the plot.
I know how to do it on the left side:


title(ylab=Title for y-axis)


But how can I have the title on the right side?

Greets,
Phil

__
R-help@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.


__
R-help@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.


[R] title and axis labels placement with layout

2010-10-04 Thread Daryl Morris

 Hello,

I'm writing a set of functions which we will use with a bunch of 
different datasets.  The functions create a set of graphics pages, with 
each page split into an upper panel with plots and a lower panel with 
tables.  The plots part might have one plot, or might have multiple.  
I'm using layout() to split the region into a top part for plots and a 
bottom part for 2 tables side-by-side.  For the tables below, I'm using 
textplot() from the gplots package.  I'm trying to get it so that the 
layout of the full page looks exactly the same regardless of the plot.


My working test case creates a boxplot with a few groups on one page, 
and 6 boxplots each with 3 groups on another page.  R automatically 
scales the cex parameter such that, for example, the points are 
smaller on the more complicated plots.


I can live with different point sizes.  But, I want the tables to have 
the same size below.  After much trial and error, I determined that I 
had to set cex OUTSIDE of textplot in order to get the sizes of the 
tables to be the same across pages.


But, what I can't get to work are 2 things:
(1) the ylabel placement (horizontally) for the top plot depends on the 
graphics in a way that I can't figure out.  (I've tried setting 
cex,lheight and many combinations of padj, line using both the plot 
function itself and title, mtext functions after the plot call).
(2) I can't figure out how to put a title on the tables such that they 
end up in repeatable position.  Again, I've tried all the various 
options I tried in (1) here again.


One solution to (1) would be if I could place the label using a 
measurement rather than a line number.  (analogous to using par(mai) 
instead of par(mar))

One solution to (2) would be that textplot include a main option.


thanks,
Daryl Morris
SCHARP, FHCRC, UW Biostatistics

__
R-help@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.


Re: [R] title and axis labels placement with layout

2010-10-04 Thread Greg Snow
You might want to look at the addtable2plot function in the plotrix package as 
an alternative for your tables.

For placing titles/labels/etc. look at the grconvertX and grconvertY functions 
for ways to get coordinates based on the device converted to other coordinate 
systems.  You can use those with the text function (or others) to place a label 
at a fixed position on the device.

Another option is to include an empty plot area in the layout to place the 
titles/labels into.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
 project.org] On Behalf Of Daryl Morris
 Sent: Monday, October 04, 2010 12:34 PM
 To: r-help@r-project.org
 Subject: [R] title and axis labels placement with layout
 
   Hello,
 
 I'm writing a set of functions which we will use with a bunch of
 different datasets.  The functions create a set of graphics pages, with
 each page split into an upper panel with plots and a lower panel with
 tables.  The plots part might have one plot, or might have multiple.
 I'm using layout() to split the region into a top part for plots and a
 bottom part for 2 tables side-by-side.  For the tables below, I'm using
 textplot() from the gplots package.  I'm trying to get it so that the
 layout of the full page looks exactly the same regardless of the plot.
 
 My working test case creates a boxplot with a few groups on one page,
 and 6 boxplots each with 3 groups on another page.  R automatically
 scales the cex parameter such that, for example, the points are
 smaller on the more complicated plots.
 
 I can live with different point sizes.  But, I want the tables to have
 the same size below.  After much trial and error, I determined that I
 had to set cex OUTSIDE of textplot in order to get the sizes of the
 tables to be the same across pages.
 
 But, what I can't get to work are 2 things:
 (1) the ylabel placement (horizontally) for the top plot depends on the
 graphics in a way that I can't figure out.  (I've tried setting
 cex,lheight and many combinations of padj, line using both the plot
 function itself and title, mtext functions after the plot call).
 (2) I can't figure out how to put a title on the tables such that they
 end up in repeatable position.  Again, I've tried all the various
 options I tried in (1) here again.
 
 One solution to (1) would be if I could place the label using a
 measurement rather than a line number.  (analogous to using par(mai)
 instead of par(mar))
 One solution to (2) would be that textplot include a main option.
 
 
 thanks,
 Daryl Morris
 SCHARP, FHCRC, UW Biostatistics
 
 __
 R-help@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.

__
R-help@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.


[R] Title splitting function

2010-01-22 Thread Michael Pearmain
Hi All,

I'm trying to write a function to automatically split long strings so they
will appear nicely in a chart i'm trying to create,

Say i have a string

title - some variety of words that are descriptive

In this instance i want to place carriage return where there is a space just
prior to a specified number of characters (in this case 15)

title.length - nchar(title)
no.splits - floor(title.length / 15)
space.title - c(gregexpr([[:space:]], title)[[1]])

space.title # This tells me the position of all spaces in the title
[1]  5 13 16 22 27 31
 no.splits # This tells me how many carriage returns i will need
[1] 2
 title.length # this tells me teh total length of the title string
[1] 42

I can then check to see where the last value is for each string i.e. where i
should make the break with (no.splits * characters (i.e 15)
 15  space.title ##(15 * 1 split)
[1] FALSE FALSE  TRUE  TRUE  TRUE  TRUE
 30  space.title  ## (15 *2 splits)
[1] FALSE FALSE FALSE FALSE FALSE  TRUE


(I'm guessing i need to create some loop or apply here)

So i know i need to do a sub at positions 13 and 27 of  to \n

So my final output would appear as
title - some variety\nof words that are\ndescriptive

But i'm getting stuck as to find a way to work out the the positions 13, 27
dynamically and returning them to use later
Can anyone offer any advise?

Thanks All.

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Title splitting function

2010-01-22 Thread Ista Zahn
Hi Michael,
It looks like you're having fun, I hope I don't spoil it for you:

title - some variety of words that are descriptive
paste(strwrap(title, width=16), collapse=\n)

-Ista

On Fri, Jan 22, 2010 at 9:07 PM, Michael Pearmain mpearm...@google.com wrote:
 Hi All,

 I'm trying to write a function to automatically split long strings so they
 will appear nicely in a chart i'm trying to create,

 Say i have a string

 title - some variety of words that are descriptive

 In this instance i want to place carriage return where there is a space just
 prior to a specified number of characters (in this case 15)

 title.length - nchar(title)
 no.splits - floor(title.length / 15)
 space.title - c(gregexpr([[:space:]], title)[[1]])

 space.title # This tells me the position of all spaces in the title
 [1]  5 13 16 22 27 31
 no.splits # This tells me how many carriage returns i will need
 [1] 2
 title.length # this tells me teh total length of the title string
 [1] 42

 I can then check to see where the last value is for each string i.e. where i
 should make the break with (no.splits * characters (i.e 15)
  15  space.title ##(15 * 1 split)
 [1] FALSE FALSE  TRUE  TRUE  TRUE  TRUE
 30  space.title  ## (15 *2 splits)
 [1] FALSE FALSE FALSE FALSE FALSE  TRUE


 (I'm guessing i need to create some loop or apply here)

 So i know i need to do a sub at positions 13 and 27 of  to \n

 So my final output would appear as
 title - some variety\nof words that are\ndescriptive

 But i'm getting stuck as to find a way to work out the the positions 13, 27
 dynamically and returning them to use later
 Can anyone offer any advise?

 Thanks All.

        [[alternative HTML version deleted]]

 __
 R-help@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.




-- 
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org

__
R-help@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.


[R] title problem

2009-11-21 Thread carol white
Hi,
I got problem in using title function to create a title for multiple plots 
presented together by par. As can be seen in the attached file, the title is 
displayed truncated and the subtitle doesn't get displayed. Here is the code:

  par(mfrow = c(1,2))
 plot(c(1,2,3), c(9,8,7))
 plot(c(1,2,3), c(9,8,7))
 title(main = Main title, sub =Sub title,outer = TRUE, cex.main=1.5, 
cex.sub = 1.5)

Carol


  attachment: titlePb.png__
R-help@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.


Re: [R] title problem

2009-11-21 Thread Gary
Hi Carol,

Try this

  par(oma=c(2,2,2,2))
  par(mfrow = c(1,2))
  plot(c(1,2,3), c(9,8,7))
  plot(c(1,2,3), c(9,8,7))
  title(main = Main title, sub =Sub title,outer = TRUE, cex.main=1.5,
cex.sub = 1.5)

par(oma=c(2,2,2,2)) -- can be used to define outline of the plot. Arguments
here are for bottom, left, top, right; which ofcourse can be changed
according to need. HTH

~Gary

On Sat, Nov 21, 2009 at 11:21 AM, carol white wht_...@yahoo.com wrote:

 Hi,
 I got problem in using title function to create a title for multiple plots
 presented together by par. As can be seen in the attached file, the title is
 displayed truncated and the subtitle doesn't get displayed. Here is the
 code:

  par(mfrow = c(1,2))
  plot(c(1,2,3), c(9,8,7))
  plot(c(1,2,3), c(9,8,7))
  title(main = Main title, sub =Sub title,outer = TRUE, cex.main=1.5,
 cex.sub = 1.5)

 Carol



 __
 R-help@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.



[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] title problem

2009-11-21 Thread David Winsemius


On Nov 21, 2009, at 11:39 AM, Gary wrote:


Hi Carol,

Try this


par(oma=c(2,2,2,2))
par(mfrow = c(1,2))
plot(c(1,2,3), c(9,8,7))
plot(c(1,2,3), c(9,8,7))
title(main = Main title, sub =Sub title,outer = TRUE,  
cex.main=1.5,

cex.sub = 1.5)


I'm curious about what you are seeing with that sequence. On a Mac  
running R 2.10.0 I am not seeing the subtitle.


--
David


par(oma=c(2,2,2,2)) -- can be used to define outline of the plot.  
Arguments
here are for bottom, left, top, right; which ofcourse can be  
changed

according to need. HTH

~Gary

On Sat, Nov 21, 2009 at 11:21 AM, carol white wht_...@yahoo.com  
wrote:



Hi,
I got problem in using title function to create a title for  
multiple plots
presented together by par. As can be seen in the attached file, the  
title is
displayed truncated and the subtitle doesn't get displayed. Here is  
the

code:

par(mfrow = c(1,2))
plot(c(1,2,3), c(9,8,7))
plot(c(1,2,3), c(9,8,7))
title(main = Main title, sub =Sub title,outer = TRUE,  
cex.main=1.5,

cex.sub = 1.5)

Carol



__
R-help@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.




[[alternative HTML version deleted]]

__
R-help@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.


David Winsemius, MD
Heritage Laboratories
West Hartford, CT

__
R-help@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.


Re: [R] title problem

2009-11-21 Thread carol white
subtitle still doesn't get displayed

--- On Sat, 11/21/09, Gurmeet gurm...@email.unc.edu wrote:

 From: Gurmeet gurm...@email.unc.edu
 Subject: Re: [R] title problem
 To: carol white wht_...@yahoo.com
 Cc: r-help@r-project.org
 Date: Saturday, November 21, 2009, 8:30 AM
 Hi Carol,
 Try this
   par(oma=c(2,2,2,2))
  par(mfrow = c(1,2))  plot(c(1,2,3),
 c(9,8,7))  plot(c(1,2,3),
 c(9,8,7))
   title(main = Main title, sub =Sub
 title,outer = TRUE, cex.main=1.5, cex.sub =
 1.5)
 par(oma=c(2,2,2,2)) -- can be used to define outline
 of the plot. Arguments here are for bottom,
 left, top, right; which
 ofcourse can be changed according to need. HTH
 
 Gurmeet
 
 On Sat, Nov 21, 2009 at 11:21 AM,
 carol white wht_...@yahoo.com
 wrote:
 
 Hi,
 
 I got problem in using title function to create a title for
 multiple plots presented together by par. As can be seen in
 the attached file, the title is displayed truncated and the
 subtitle doesn't get displayed. Here is the code:
 
 
 
 
   par(mfrow = c(1,2))
 
  plot(c(1,2,3), c(9,8,7))
 
  plot(c(1,2,3), c(9,8,7))
 
  title(main = Main title, sub =Sub
 title,outer = TRUE, cex.main=1.5, cex.sub = 1.5)
 
 
 
 Carol
 
 
 
 
 
       
 __
 
 R-help@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.
 
 
 
 
 



__
R-help@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.


Re: [R] title problem

2009-11-21 Thread Gary
You are right David/Carol. It seems outer=T does not work for Sub title.
I'm not sure what Carol is looking for, but in case you need separate sub
titles for each graph, then you may want to use more than one title
statement. Like:

par(oma=c(2,2,2,2))
par(mfrow = c(1,2))
plot(c(1,2,3), c(9,8,7))
title(sub =sub title 1, cex.sub = 0.75)
plot(c(1,2,3), c(9,8,7))
title(sub =sub title 2, cex.sub = 0.75)
title(main = Main title, cex.main=1.5, outer = TRUE)

Not sure about how to do it for a single sub title for whole graph.
Anyone?
~Gary


On Sat, Nov 21, 2009 at 12:07 PM, David Winsemius dwinsem...@comcast.netwrote:


 On Nov 21, 2009, at 11:39 AM, Gary wrote:

  Hi Carol,

 Try this

  par(oma=c(2,2,2,2))
 par(mfrow = c(1,2))
 plot(c(1,2,3), c(9,8,7))
 plot(c(1,2,3), c(9,8,7))
 title(main = Main title, sub =Sub title,outer = TRUE, cex.main=1.5,

 cex.sub = 1.5)


 I'm curious about what you are seeing with that sequence. On a Mac running
 R 2.10.0 I am not seeing the subtitle.

 --
 David


 par(oma=c(2,2,2,2)) -- can be used to define outline of the plot.
 Arguments
 here are for bottom, left, top, right; which ofcourse can be
 changed
 according to need. HTH

 ~Gary

 On Sat, Nov 21, 2009 at 11:21 AM, carol white wht_...@yahoo.com wrote:

  Hi,
 I got problem in using title function to create a title for multiple
 plots
 presented together by par. As can be seen in the attached file, the title
 is
 displayed truncated and the subtitle doesn't get displayed. Here is the
 code:

 par(mfrow = c(1,2))
 plot(c(1,2,3), c(9,8,7))
 plot(c(1,2,3), c(9,8,7))
 title(main = Main title, sub =Sub title,outer = TRUE, cex.main=1.5,
 cex.sub = 1.5)

 Carol



 __
 R-help@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.



[[alternative HTML version deleted]]

 __
 R-help@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.


 David Winsemius, MD
 Heritage Laboratories
 West Hartford, CT



[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] title problem

2009-11-21 Thread carol white
Thanks Gary. No I want one subtitle for all plots below the main title. 
subtitle should work but if doesn't at the worst case I could do as follows:

title(main = Main title\nSub title,outer = TRUE, cex.main=1.5,...)

--- On Sat, 11/21/09, Gary mail2garymil...@gmail.com wrote:

 From: Gary mail2garymil...@gmail.com
 Subject: Re: [R] title problem
 To: David Winsemius dwinsem...@comcast.net
 Cc: carol white wht_...@yahoo.com, r-help list r-help@r-project.org
 Date: Saturday, November 21, 2009, 9:39 AM
 You are right David/Carol. It seems outer=T
 does not work for Sub title. I'm not sure
 what Carol is looking for, but in case you need separate sub
 titles for each graph, then you may want to use more than
 one title statement. Like:
 
 
 par(oma=c(2,2,2,2))par(mfrow =
 c(1,2))plot(c(1,2,3),
 c(9,8,7))title(sub =sub title 1,
 cex.sub = 0.75)plot(c(1,2,3),
 c(9,8,7))title(sub =sub title 2,
 cex.sub = 0.75)
 
 title(main = Main title,
 cex.main=1.5, outer = TRUE)
 Not sure about how to do it for a single
 sub title for whole graph.
 Anyone?~Gary
  
 
 
 
 On Sat, Nov 21, 2009 at 12:07 PM,
 David Winsemius dwinsem...@comcast.net
 wrote:
 
 
 
 
 On Nov 21, 2009, at 11:39 AM, Gary wrote:
 
 
 
 
 Hi Carol,
 
 
 
 Try this
 
 
 
 
 par(oma=c(2,2,2,2))
 
 par(mfrow = c(1,2))
 
 plot(c(1,2,3), c(9,8,7))
 
 plot(c(1,2,3), c(9,8,7))
 
 title(main = Main title, sub =Sub
 title,outer = TRUE, cex.main=1.5,
 
 
 cex.sub = 1.5)
 
 
 
 
 I'm curious about what you are seeing with that
 sequence. On a Mac running R 2.10.0 I am not seeing the
 subtitle.
 
 
 
 -- 
 
 David
 
 
 
 
 par(oma=c(2,2,2,2)) -- can be used to define outline of the
 plot. Arguments
 
 here are for bottom, left,
 top, right; which ofcourse can be
 changed
 
 according to need. HTH
 
 
 
 ~Gary
 
 
 
 On Sat, Nov 21, 2009 at 11:21 AM, carol white wht_...@yahoo.com
 wrote:
 
 
 
 
 Hi,
 
 I got problem in using title function to create a title for
 multiple plots
 
 presented together by par. As can be seen in the attached
 file, the title is
 
 displayed truncated and the subtitle doesn't get
 displayed. Here is the
 
 code:
 
 
 
 par(mfrow = c(1,2))
 
 plot(c(1,2,3), c(9,8,7))
 
 plot(c(1,2,3), c(9,8,7))
 
 title(main = Main title, sub =Sub
 title,outer = TRUE, cex.main=1.5,
 
 cex.sub = 1.5)
 
 
 
 Carol
 
 
 
 
 
 
 
 __
 
 R-help@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.
 
 
 
 
 
 
 
 
         [[alternative HTML version deleted]]
 
 
 
 __
 
 R-help@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.
 
 
 
 
 David Winsemius, MD
 
 Heritage Laboratories
 
 West Hartford, CT
 
 
 
 
 
 




__
R-help@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.


Re: [R] title problem

2009-11-21 Thread Gabor Grothendieck
Try the line= argument on title()

opar - par(oma = 4 * c(1, 1, 1, 1), no.readonly = TRUE)
par(mfrow = 1:2)
plot(1:3, 9:7)
plot(1:3, 7:9)
for(i in 1:3) title(main = i, line = i, outer = TRUE)
par(opar)


On Sat, Nov 21, 2009 at 12:47 PM, carol white wht_...@yahoo.com wrote:
 Thanks Gary. No I want one subtitle for all plots below the main title. 
 subtitle should work but if doesn't at the worst case I could do as follows:

 title(main = Main title\nSub title,outer = TRUE, cex.main=1.5,...)

 --- On Sat, 11/21/09, Gary mail2garymil...@gmail.com wrote:

 From: Gary mail2garymil...@gmail.com
 Subject: Re: [R] title problem
 To: David Winsemius dwinsem...@comcast.net
 Cc: carol white wht_...@yahoo.com, r-help list r-help@r-project.org
 Date: Saturday, November 21, 2009, 9:39 AM
 You are right David/Carol. It seems outer=T
 does not work for Sub title. I'm not sure
 what Carol is looking for, but in case you need separate sub
 titles for each graph, then you may want to use more than
 one title statement. Like:


 par(oma=c(2,2,2,2))par(mfrow =
 c(1,2))plot(c(1,2,3),
 c(9,8,7))title(sub =sub title 1,
 cex.sub = 0.75)plot(c(1,2,3),
 c(9,8,7))title(sub =sub title 2,
 cex.sub = 0.75)

 title(main = Main title,
 cex.main=1.5, outer = TRUE)
 Not sure about how to do it for a single
 sub title for whole graph.
 Anyone?~Gary




 On Sat, Nov 21, 2009 at 12:07 PM,
 David Winsemius dwinsem...@comcast.net
 wrote:




 On Nov 21, 2009, at 11:39 AM, Gary wrote:




 Hi Carol,



 Try this




 par(oma=c(2,2,2,2))

 par(mfrow = c(1,2))

 plot(c(1,2,3), c(9,8,7))

 plot(c(1,2,3), c(9,8,7))

 title(main = Main title, sub =Sub
 title,outer = TRUE, cex.main=1.5,


 cex.sub = 1.5)




 I'm curious about what you are seeing with that
 sequence. On a Mac running R 2.10.0 I am not seeing the
 subtitle.



 --

 David




 par(oma=c(2,2,2,2)) -- can be used to define outline of the
 plot. Arguments

 here are for bottom, left,
 top, right; which ofcourse can be
 changed

 according to need. HTH



 ~Gary



 On Sat, Nov 21, 2009 at 11:21 AM, carol white wht_...@yahoo.com
 wrote:




 Hi,

 I got problem in using title function to create a title for
 multiple plots

 presented together by par. As can be seen in the attached
 file, the title is

 displayed truncated and the subtitle doesn't get
 displayed. Here is the

 code:



 par(mfrow = c(1,2))

 plot(c(1,2,3), c(9,8,7))

 plot(c(1,2,3), c(9,8,7))

 title(main = Main title, sub =Sub
 title,outer = TRUE, cex.main=1.5,

 cex.sub = 1.5)



 Carol







 __

 R-help@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.








         [[alternative HTML version deleted]]



 __

 R-help@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.




 David Winsemius, MD

 Heritage Laboratories

 West Hartford, CT










 __
 R-help@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.


__
R-help@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.


Re: [R] title problem

2009-11-21 Thread David Winsemius


On Nov 21, 2009, at 12:57 PM, Gabor Grothendieck wrote:


Try the line= argument on title()

opar - par(oma = 4 * c(1, 1, 1, 1), no.readonly = TRUE)
par(mfrow = 1:2)
plot(1:3, 9:7)
plot(1:3, 7:9)
for(i in 1:3) title(main = i, line = i, outer = TRUE)
par(opar)



I was not sure what Carol was hoping for. I assumed she was hoping for  
the full page analog of what subtitle would do with an individual  
plot, i.e. that the subtitle would be below the plots and centered. If  
she were hoping for just another line below the main title, then your  
strategy or using \n within the string would be effective.


I think that she may need to use mtext() in order to get a true sub- 
title of the first sort.


--
David.



On Sat, Nov 21, 2009 at 12:47 PM, carol white wht_...@yahoo.com  
wrote:
Thanks Gary. No I want one subtitle for all plots below the main  
title. subtitle should work but if doesn't at the worst case I  
could do as follows:


title(main = Main title\nSub title,outer = TRUE, cex.main=1.5,...)

--- On Sat, 11/21/09, Gary mail2garymil...@gmail.com wrote:


From: Gary mail2garymil...@gmail.com
Subject: Re: [R] title problem
To: David Winsemius dwinsem...@comcast.net
Cc: carol white wht_...@yahoo.com, r-help list r-help@r-project.org 


Date: Saturday, November 21, 2009, 9:39 AM
You are right David/Carol. It seems outer=T
does not work for Sub title. I'm not sure
what Carol is looking for, but in case you need separate sub
titles for each graph, then you may want to use more than
one title statement. Like:


par(oma=c(2,2,2,2))par(mfrow =
c(1,2))plot(c(1,2,3),
c(9,8,7))title(sub =sub title 1,
cex.sub = 0.75)plot(c(1,2,3),
c(9,8,7))title(sub =sub title 2,
cex.sub = 0.75)

title(main = Main title,
cex.main=1.5, outer = TRUE)
Not sure about how to do it for a single
sub title for whole graph.
Anyone?~Gary




On Sat, Nov 21, 2009 at 12:07 PM,
David Winsemius dwinsem...@comcast.net
wrote:




On Nov 21, 2009, at 11:39 AM, Gary wrote:




Hi Carol,



Try this




par(oma=c(2,2,2,2))

par(mfrow = c(1,2))

plot(c(1,2,3), c(9,8,7))

plot(c(1,2,3), c(9,8,7))

title(main = Main title, sub =Sub
title,outer = TRUE, cex.main=1.5,


cex.sub = 1.5)




I'm curious about what you are seeing with that
sequence. On a Mac running R 2.10.0 I am not seeing the
subtitle.



--

David




par(oma=c(2,2,2,2)) -- can be used to define outline of the
plot. Arguments

here are for bottom, left,
top, right; which ofcourse can be
changed

according to need. HTH



~Gary



On Sat, Nov 21, 2009 at 11:21 AM, carol white wht_...@yahoo.com
wrote:




Hi,

I got problem in using title function to create a title for
multiple plots

presented together by par. As can be seen in the attached
file, the title is

displayed truncated and the subtitle doesn't get
displayed. Here is the

code:



par(mfrow = c(1,2))

plot(c(1,2,3), c(9,8,7))

plot(c(1,2,3), c(9,8,7))

title(main = Main title, sub =Sub
title,outer = TRUE, cex.main=1.5,

cex.sub = 1.5)



Carol







__

R-help@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.








[[alternative HTML version deleted]]



__

R-help@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.




David Winsemius, MD

Heritage Laboratories

West Hartford, CT











__
R-help@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.



__
R-help@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.


David Winsemius, MD
Heritage Laboratories
West Hartford, CT

__
R-help@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.


Re: [R] title problem

2009-11-21 Thread Gary
I think Gabor suggestion works. Adding line= option in title makes it
work. Here is a little modification of what Gabor suggested, Carol you may
try this code:

par(oma=c(3,1,4,1))
par(mfrow = c(1,2))
plot(c(1,2,3), c(9,8,7))
plot(c(1,2,3), c(9,8,7))
title(main = Main title line1\nMain title line2, cex.main=1.5, line=1, sub
= Sub title line1\nSub title line2, cex.sub = 0.75, outer = TRUE)

~Gary


On Sat, Nov 21, 2009 at 1:09 PM, David Winsemius dwinsem...@comcast.netwrote:


 On Nov 21, 2009, at 12:57 PM, Gabor Grothendieck wrote:

  Try the line= argument on title()

 opar - par(oma = 4 * c(1, 1, 1, 1), no.readonly = TRUE)
 par(mfrow = 1:2)
 plot(1:3, 9:7)
 plot(1:3, 7:9)
 for(i in 1:3) title(main = i, line = i, outer = TRUE)
 par(opar)


 I was not sure what Carol was hoping for. I assumed she was hoping for the
 full page analog of what subtitle would do with an individual plot, i.e.
 that the subtitle would be below the plots and centered. If she were hoping
 for just another line below the main title, then your strategy or using \n
 within the string would be effective.

 I think that she may need to use mtext() in order to get a true sub-title
 of the first sort.

 --
 David.



 On Sat, Nov 21, 2009 at 12:47 PM, carol white wht_...@yahoo.com wrote:

 Thanks Gary. No I want one subtitle for all plots below the main title.
 subtitle should work but if doesn't at the worst case I could do as follows:

 title(main = Main title\nSub title,outer = TRUE, cex.main=1.5,...)

 --- On Sat, 11/21/09, Gary mail2garymil...@gmail.com wrote:

  From: Gary mail2garymil...@gmail.com
 Subject: Re: [R] title problem
 To: David Winsemius dwinsem...@comcast.net
 Cc: carol white wht_...@yahoo.com, r-help list 
 r-help@r-project.org
 Date: Saturday, November 21, 2009, 9:39 AM
 You are right David/Carol. It seems outer=T
 does not work for Sub title. I'm not sure
 what Carol is looking for, but in case you need separate sub
 titles for each graph, then you may want to use more than
 one title statement. Like:


 par(oma=c(2,2,2,2))par(mfrow =
 c(1,2))plot(c(1,2,3),
 c(9,8,7))title(sub =sub title 1,
 cex.sub = 0.75)plot(c(1,2,3),
 c(9,8,7))title(sub =sub title 2,
 cex.sub = 0.75)

 title(main = Main title,
 cex.main=1.5, outer = TRUE)
 Not sure about how to do it for a single
 sub title for whole graph.
 Anyone?~Gary




 On Sat, Nov 21, 2009 at 12:07 PM,
 David Winsemius dwinsem...@comcast.net
 wrote:




 On Nov 21, 2009, at 11:39 AM, Gary wrote:




 Hi Carol,



 Try this




 par(oma=c(2,2,2,2))

 par(mfrow = c(1,2))

 plot(c(1,2,3), c(9,8,7))

 plot(c(1,2,3), c(9,8,7))

 title(main = Main title, sub =Sub
 title,outer = TRUE, cex.main=1.5,


 cex.sub = 1.5)




 I'm curious about what you are seeing with that
 sequence. On a Mac running R 2.10.0 I am not seeing the
 subtitle.



 --

 David




 par(oma=c(2,2,2,2)) -- can be used to define outline of the
 plot. Arguments

 here are for bottom, left,
 top, right; which ofcourse can be
 changed

 according to need. HTH



 ~Gary



 On Sat, Nov 21, 2009 at 11:21 AM, carol white wht_...@yahoo.com
 wrote:




 Hi,

 I got problem in using title function to create a title for
 multiple plots

 presented together by par. As can be seen in the attached
 file, the title is

 displayed truncated and the subtitle doesn't get
 displayed. Here is the

 code:



 par(mfrow = c(1,2))

 plot(c(1,2,3), c(9,8,7))

 plot(c(1,2,3), c(9,8,7))

 title(main = Main title, sub =Sub
 title,outer = TRUE, cex.main=1.5,

 cex.sub = 1.5)



 Carol







 __

 R-help@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.








[[alternative HTML version deleted]]



 __

 R-help@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.




 David Winsemius, MD

 Heritage Laboratories

 West Hartford, CT










 __
 R-help@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.


 __
 R-help@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.


 David Winsemius, MD
 Heritage Laboratories
 West Hartford, CT

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read

Re: [R] title problem

2009-11-21 Thread David Winsemius


On Nov 21, 2009, at 1:19 PM, Gary wrote:

I think Gabor suggestion works. Adding line= option in title makes  
it work. Here is a little modification of what Gabor suggested,  
Carol you may try this code:


par(oma=c(3,1,4,1))
par(mfrow = c(1,2))
plot(c(1,2,3), c(9,8,7))
plot(c(1,2,3), c(9,8,7))
title(main = Main title line1\nMain title line2, cex.main=1.5,  
line=1, sub = Sub title line1\nSub title line2, cex.sub = 0.75,  
outer = TRUE)


Agree it works. Apparently setting line to something other than the  
default = NA is necessary. To get it to work as I expected I needed to  
set line=0. The help page was not particularly helpful in this regard.  
Am I correct in thinking that title() adds 1 to NA and gets NA for the  
subtitle placement, but that this is not happening for the title  
placement? (Could not figure out what was really happening because  
could not expose the code of as.graphicAnnot(). If so, shouldn't this  
be fixed?


oprar - par(oma=c(1,1,2,1))
par(mfrow = c(1,2))
plot(c(1,2,3), c(9,8,7))
plot(c(1,2,3), c(9,8,7))
title(main = Main title line1\nline2, line=0, sub = Sub title  
line1,  outer = TRUE)

par(opar)


So now the number of displayed lines equals the number of specified  
lines in par()$oma


--
David.


~Gary


On Sat, Nov 21, 2009 at 1:09 PM, David Winsemius dwinsem...@comcast.net 
 wrote:


On Nov 21, 2009, at 12:57 PM, Gabor Grothendieck wrote:

Try the line= argument on title()

opar - par(oma = 4 * c(1, 1, 1, 1), no.readonly = TRUE)
par(mfrow = 1:2)
plot(1:3, 9:7)
plot(1:3, 7:9)
for(i in 1:3) title(main = i, line = i, outer = TRUE)
par(opar)


I was not sure what Carol was hoping for. I assumed she was hoping  
for the full page analog of what subtitle would do with an  
individual plot, i.e. that the subtitle would be below the plots and  
centered. If she were hoping for just another line below the main  
title, then your strategy or using \n within the string would be  
effective.


I think that she may need to use mtext() in order to get a true  
sub-title of the first sort.


--
David.



On Sat, Nov 21, 2009 at 12:47 PM, carol white wht_...@yahoo.com  
wrote:
Thanks Gary. No I want one subtitle for all plots below the main  
title. subtitle should work but if doesn't at the worst case I could  
do as follows:


title(main = Main title\nSub title,outer = TRUE, cex.main=1.5,...)

--- On Sat, 11/21/09, Gary mail2garymil...@gmail.com wrote:

From: Gary mail2garymil...@gmail.com
Subject: Re: [R] title problem
To: David Winsemius dwinsem...@comcast.net
Cc: carol white wht_...@yahoo.com, r-help list r-help@r-project.org 


Date: Saturday, November 21, 2009, 9:39 AM
You are right David/Carol. It seems outer=T
does not work for Sub title. I'm not sure
what Carol is looking for, but in case you need separate sub
titles for each graph, then you may want to use more than
one title statement. Like:


par(oma=c(2,2,2,2))par(mfrow =
c(1,2))plot(c(1,2,3),
c(9,8,7))title(sub =sub title 1,
cex.sub = 0.75)plot(c(1,2,3),
c(9,8,7))title(sub =sub title 2,
cex.sub = 0.75)

title(main = Main title,
cex.main=1.5, outer = TRUE)
Not sure about how to do it for a single
sub title for whole graph.
Anyone?~Gary




On Sat, Nov 21, 2009 at 12:07 PM,
David Winsemius dwinsem...@comcast.net
wrote:




On Nov 21, 2009, at 11:39 AM, Gary wrote:




Hi Carol,



Try this




par(oma=c(2,2,2,2))

par(mfrow = c(1,2))

plot(c(1,2,3), c(9,8,7))

plot(c(1,2,3), c(9,8,7))

title(main = Main title, sub =Sub
title,outer = TRUE, cex.main=1.5,


cex.sub = 1.5)




I'm curious about what you are seeing with that
sequence. On a Mac running R 2.10.0 I am not seeing the
subtitle.



--

David




par(oma=c(2,2,2,2)) -- can be used to define outline of the
plot. Arguments

here are for bottom, left,
top, right; which ofcourse can be
changed

according to need. HTH



~Gary



On Sat, Nov 21, 2009 at 11:21 AM, carol white wht_...@yahoo.com
wrote:




Hi,

I got problem in using title function to create a title for
multiple plots

presented together by par. As can be seen in the attached
file, the title is

displayed truncated and the subtitle doesn't get
displayed. Here is the

code:



par(mfrow = c(1,2))

plot(c(1,2,3), c(9,8,7))

plot(c(1,2,3), c(9,8,7))

title(main = Main title, sub =Sub
title,outer = TRUE, cex.main=1.5,

cex.sub = 1.5)



Carol







__

R-help@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.








   [[alternative HTML version deleted]]



__

R-help@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.




David Winsemius, MD

Heritage Laboratories

West Hartford, CT

Re: [R] title problem

2009-11-21 Thread Gurmeet
Hi Carol,

Try this

  par(oma=c(2,2,2,2))
  par(mfrow = c(1,2))
  plot(c(1,2,3), c(9,8,7))
  plot(c(1,2,3), c(9,8,7))
  title(main = Main title, sub =Sub title,outer = TRUE, cex.main=1.5,
cex.sub = 1.5)

par(oma=c(2,2,2,2)) -- can be used to define outline of the plot. Arguments
here are for bottom, left, top, right; which ofcourse can be changed
according to need. HTH

Gurmeet


On Sat, Nov 21, 2009 at 11:21 AM, carol white wht_...@yahoo.com wrote:

 Hi,
 I got problem in using title function to create a title for multiple plots
 presented together by par. As can be seen in the attached file, the title is
 displayed truncated and the subtitle doesn't get displayed. Here is the
 code:

  par(mfrow = c(1,2))
  plot(c(1,2,3), c(9,8,7))
  plot(c(1,2,3), c(9,8,7))
  title(main = Main title, sub =Sub title,outer = TRUE, cex.main=1.5,
 cex.sub = 1.5)

 Carol



 __
 R-help@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.



[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] title problem

2009-11-21 Thread Peter Ehlers


David Winsemius wrote:


On Nov 21, 2009, at 1:19 PM, Gary wrote:

I think Gabor suggestion works. Adding line= option in title makes 
it work. Here is a little modification of what Gabor suggested, Carol 
you may try this code:


par(oma=c(3,1,4,1))
par(mfrow = c(1,2))
plot(c(1,2,3), c(9,8,7))
plot(c(1,2,3), c(9,8,7))
title(main = Main title line1\nMain title line2, cex.main=1.5, 
line=1, sub = Sub title line1\nSub title line2, cex.sub = 0.75, 
outer = TRUE)


Agree it works. Apparently setting line to something other than the 
default = NA is necessary. To get it to work as I expected I needed to 
set line=0. The help page was not particularly helpful in this regard. 
Am I correct in thinking that title() adds 1 to NA and gets NA for the 
subtitle placement, but that this is not happening for the title 
placement? (Could not figure out what was really happening because could 
not expose the code of as.graphicAnnot(). If so, shouldn't this be fixed?


oprar - par(oma=c(1,1,2,1))
par(mfrow = c(1,2))
plot(c(1,2,3), c(9,8,7))
plot(c(1,2,3), c(9,8,7))
title(main = Main title line1\nline2, line=0, sub = Sub title 
line1,  outer = TRUE)

par(opar)


So now the number of displayed lines equals the number of specified 
lines in par()$oma



At the risk of beating a dead horse, let me add this:
I always use two calls to title(), one for main and one
for sub. This gives me flexibility in setting different
values for the line argument. Or, of course, one can use
mtext() as suggested earlier by David.

 -Peter Ehlers

__
R-help@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.


Re: [R] title: words in different colors?

2009-01-22 Thread Barry Rowlingson
Here's my version of the technicolor title function:

multiTitle - function(...){
###
### multi-coloured title
###
### examples:
###  multiTitle(color=red,Traffic,
### color=orange, light ,
### color=green,signal)
###
### - note triple backslashes needed for embedding quotes:
###
###  multiTitle(color=orange,Hello ,
### color=red, \\\world\\\!)
###
### Barry Rowlingson b.rowling...@lancaster.ac.uk
###
  l = list(...)
  ic = names(l)=='color'
  colors = unique(unlist(l[ic]))

  for(i in colors){
color=par()$col.main
strings=c()
for(il in 1:length(l)){
  p = l[[il]]
  if(ic[il]){ # if this is a color:
if(p==i){  # if it's the current color
  current=TRUE
}else{
  current=FALSE
}
  }else{ # it's some text
if(current){
  # set as text
  strings = c(strings,paste('',p,'',sep=))
}else{
  # set as phantom
  strings = c(strings,paste(phantom(\,p,\),sep=))
}
  }
} # next item
## now plot this color
prod=paste(strings,collapse=*)
express = paste(expression(,prod,),sep=)
e=eval(parse(text=express))
title(e,col.main=i)
  } # next color
  return()
}

__
R-help@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.


[R] title: words in different colors?

2009-01-21 Thread Michael Friendly

In ?title I see the

plot(cars, main = )
title(main = list(Stopping Distance versus Speed, cex=1.5, col=red, 
font=3))


I can't seem to generalize this to use several colors in a single title. 
What I'd like is

in latex-ish

\red{Hair color} \black{ and } \blue{Eye color}

to serve also as an implicit legend for points that are plotted.

-Michael

--
Michael Friendly Email: friendly AT yorku DOT ca 
Professor, Psychology Dept.

York University  Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele Streethttp://www.math.yorku.ca/SCS/friendly.html
Toronto, ONT  M3J 1P3 CANADA

__
R-help@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.


Re: [R] title: words in different colors?

2009-01-21 Thread Barry Rowlingson
2009/1/21 Michael Friendly frien...@yorku.ca:
 In ?title I see the

 plot(cars, main = )
 title(main = list(Stopping Distance versus Speed, cex=1.5, col=red,
 font=3))

 I can't seem to generalize this to use several colors in a single title.

 Solution from http://tolstoy.newcastle.edu.au/R/e2/help/07/09/24599.html
adapted for title:

  plot(1:10)
  title(expression(hair Color * phantom( and Eye color)),col.main=red)
  title(expression(phantom(hair Color and ) * Eye color),col.main=blue)
  title(expression(phantom(hair Color ) * and * phantom(Eye
color),col.main=black))

 The trick is to overlay three titles, one for each colour, with the
stuff not in that colour wrapped in a phantom() call to produce the
correct spacing in invisible ink.

  There's probably other ways...

Barry

__
R-help@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.


Re: [R] title: words in different colors?

2009-01-21 Thread Duncan Murdoch

Michael Friendly wrote:

In ?title I see the

plot(cars, main = )
 title(main = list(Stopping Distance versus Speed, cex=1.5, col=red, 
font=3))


I can't seem to generalize this to use several colors in a single title. 
What I'd like is

in latex-ish

\red{Hair color} \black{ and } \blue{Eye color}

to serve also as an implicit legend for points that are plotted.

  


I don't know a direct way, but you could put things together by using 
strwidth() on each piece, then plotting them at the appropriate position 
using mtext.  For example:


technicolorTitle - function(words, colours, cex=1) {
   widths - strwidth(words,cex=cex)
   spaces - rep(strwidth( ,cex=cex), length(widths)-1)
   middle - mean(par(usr)[1:2])
   total - sum(widths) + sum(spaces)
   start - c(0,cumsum(widths[-length(widths)] + spaces))
   start - start + middle - total/2
   mtext(words, 3, 1, at=start, adj=0, col=colours,cex=cex)
   }

plot(1)
technicolorTitle(c(Hair color, and, Eye color), c(red, black, 
blue))


(I didn't duplicate title()'s choice of position and font exactly, so 
you might want to tweak this a bit.)


Duncan Murdoch

__
R-help@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.


[R] title second y-axis in lattice plot

2008-11-25 Thread robbie . heremans
Dear R-users,

After adding the secondary y-axis at the right side of a lattice xyplot (cfr. 
Lattice:  Multivariate Data Visualization with R - figures 8.4 and 8.6, from 
http://lmdvr.r-forge.r-project.org/figures/figures.html), I'm trying to add a 
title to that second y-axis (which has to be different from the title on the 
left side).

Where should I place the ylab- instruction?


Robbie

__
R-help@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.


Re: [R] title second y-axis in lattice plot

2008-11-25 Thread Deepayan Sarkar
On 11/25/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Dear R-users,

  After adding the secondary y-axis at the right side of a lattice xyplot 
 (cfr. Lattice:  Multivariate Data Visualization with R - figures 8.4 and 8.6, 
 from http://lmdvr.r-forge.r-project.org/figures/figures.html), I'm trying to 
 add a title to that second y-axis (which has to be different from the title 
 on the left side).

  Where should I place the ylab- instruction?

The only reliable way right now is to add a legend on the right side.
I have plans to implement support for arguments 'ylab.right' and
'xlab.top', but this has not happened yet.

-Deepayan

__
R-help@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.


Re: [R] title second y-axis in lattice plot

2008-11-25 Thread Robbie Heremans

Thanks Deepayan,

The following code solves the problem until 'ylab.right' will be 
implemented.


Robbie

library(lattice)
library(grid)

g1-textGrob(axis title at right, x = unit(0.5, npc), y = unit(0.5, 
npc),

just = centre, hjust = NULL, vjust = NULL, rot = 270,
check.overlap = FALSE, default.units = npc,
name = NULL, gp = gpar(col=gray), vp = NULL)

xyplot(rnorm(10) ~ rnorm(10),
 legend =
 list(right = list(fun = g1)))


Deepayan Sarkar schreef:

On 11/25/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  

Dear R-users,

 After adding the secondary y-axis at the right side of a lattice xyplot (cfr. 
Lattice:  Multivariate Data Visualization with R - figures 8.4 and 8.6, from 
http://lmdvr.r-forge.r-project.org/figures/figures.html), I'm trying to add a 
title to that second y-axis (which has to be different from the title on the 
left side).

 Where should I place the ylab- instruction?



The only reliable way right now is to add a legend on the right side.
I have plans to implement support for arguments 'ylab.right' and
'xlab.top', but this has not happened yet.

-Deepayan
  




No virus found in this incoming message.
Checked by AVG - http://www.avg.com 
Version: 8.0.175 / Virus Database: 270.9.10/1810 - Release Date: 11/24/2008 2:36 PM





__
R-help@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.


[R] Title for graph with multiple plots

2008-07-19 Thread Tolga Uzuner

Dear R Users,
I am attempting to place a title to a graph with multiple plots that 
should go across the top of all the graphs, and not just one of them. I 
am using mfrow in par to plot. Can anyone suggest if and how this could 
be done ?

Thanks in advance,
Tolga

__
R-help@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.


Re: [R] Title for graph with multiple plots

2008-07-19 Thread Ted Harding
On 19-Jul-08 10:29:43, Tolga Uzuner wrote:
 Dear R Users,
 I am attempting to place a title to a graph with multiple plots that 
 should go across the top of all the graphs, and not just one of them. I
 am using mfrow in par to plot. Can anyone suggest if and how this could
 be done ?
 Thanks in advance,
 Tolga

The following post from Erin Hodgess gives an example of how to do it:

Date: Thu, 12 Jun 2008 11:17:28 -0500
Sender: [EMAIL PROTECTED]
From: Erin Hodgess [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [R] overall title
Cc: r-help@r-project.org

Please try this:

z1 - rexp(100)
z2 - rexp(100)
z3 - rexp(100)
z4 - rexp(100)
par(mfrow=c(2,2),oma = c(0, 0, 3, 0))
curve(dexp,from=0,to=5)
hist(z1,main=first)
hist(z2,main=second)
hist(z3,main=third)
mtext(Densities, outer = TRUE, cex = 1.5)

Hope this helps.

Sincerely,
Erin


On Thu, Jun 12, 2008 at 10:38 AM,  [EMAIL PROTECTED] wrote:
 I have a 2x2 plot set up using:  par(mfrow=c(2,2))
 I'd like to put an overall title on the page, but I cannot figure
 out how. Any ideas?

Best wishes,
Ted.


E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 19-Jul-08   Time: 18:29:01
-- XFMail --

__
R-help@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.


Re: [R] Title for graph with multiple plots

2008-07-19 Thread jim holtman
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/99281.html

RSiteSearch(overall title)

On Sat, Jul 19, 2008 at 6:29 AM, Tolga Uzuner [EMAIL PROTECTED] wrote:
 Dear R Users,
 I am attempting to place a title to a graph with multiple plots that should
 go across the top of all the graphs, and not just one of them. I am using
 mfrow in par to plot. Can anyone suggest if and how this could be done ?
 Thanks in advance,
 Tolga

 __
 R-help@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.




-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

__
R-help@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.


Re: [R] Title for graph with multiple plots

2008-07-19 Thread Tolga Uzuner

Dear Ted and Jim,
Many thanks.
Tolga

(Ted Harding) wrote:

On 19-Jul-08 10:29:43, Tolga Uzuner wrote:
  

Dear R Users,
I am attempting to place a title to a graph with multiple plots that 
should go across the top of all the graphs, and not just one of them. I

am using mfrow in par to plot. Can anyone suggest if and how this could
be done ?
Thanks in advance,
Tolga



The following post from Erin Hodgess gives an example of how to do it:

Date: Thu, 12 Jun 2008 11:17:28 -0500
Sender: [EMAIL PROTECTED]
From: Erin Hodgess [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [R] overall title
Cc: r-help@r-project.org

Please try this:

z1 - rexp(100)
z2 - rexp(100)
z3 - rexp(100)
z4 - rexp(100)
par(mfrow=c(2,2),oma = c(0, 0, 3, 0))
curve(dexp,from=0,to=5)
hist(z1,main=first)
hist(z2,main=second)
hist(z3,main=third)
mtext(Densities, outer = TRUE, cex = 1.5)

Hope this helps.

Sincerely,
Erin


On Thu, Jun 12, 2008 at 10:38 AM,  [EMAIL PROTECTED] wrote:
  

I have a 2x2 plot set up using:  par(mfrow=c(2,2))
I'd like to put an overall title on the page, but I cannot figure
out how. Any ideas?



Best wishes,
Ted.


E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 19-Jul-08   Time: 18:29:01
-- XFMail --




__
R-help@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.