Hi, I have created the plot below and have a few questions about changes. 1) How do I change the "Year" title of each plot so it reads from the top "2006","2007","2008","2009". 2) How do I get rid of those vertical grey bars in the title bar of each plot? I apologise for my ignorance... one of those days :( James http://www.nabble.com/file/p22445242/PLOT.jpg -- View this message in context: http://www.nabble.com/2-Simple-Lattice-Plot-Questions-tp22445242p22445242.html Sent from the R help mailing list archive at Nabble.com.
Convert Year to a factor and both problems will be solved. --sundar On Tue, Mar 10, 2009 at 3:48 PM, jimdare <jamesdare26 at gmail.com> wrote:> > Hi, > > I have created the plot below and have a few questions about changes. > > 1) How do I change the "Year" title of each plot so it reads from the top > "2006","2007","2008","2009". > 2) How do I get rid of those vertical grey bars in the title bar of each > plot? > > I apologise for my ignorance... one of those days :( > > James > > > http://www.nabble.com/file/p22445242/PLOT.jpg > -- > View this message in context: http://www.nabble.com/2-Simple-Lattice-Plot-Questions-tp22445242p22445242.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. >
With you first question, I had a similar problem when the year (in my case it was sample size) variable was numeric. Add as.factor in front of it and it should show you the actual levels... -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of jimdare Sent: Wednesday, 11 March 2009 9:48 AM To: r-help at r-project.org Subject: [R] 2 Simple Lattice Plot Questions Hi, I have created the plot below and have a few questions about changes. 1) How do I change the "Year" title of each plot so it reads from the top "2006","2007","2008","2009". 2) How do I get rid of those vertical grey bars in the title bar of each plot? I apologise for my ignorance... one of those days :( James http://www.nabble.com/file/p22445242/PLOT.jpg -- View this message in context: http://www.nabble.com/2-Simple-Lattice-Plot-Questions-tp22445242p22445242.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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. -- Message protected by MailGuard: e-mail anti-virus, anti-spam and content filtering. http://www.mailguard.com.au/mg https://login.mailguard.com.au/report/1x1QqLdh8M/3sazYwF0XpYQ6RvoZPBdoj/2.398
... but in general ?strip.default will explain these matters. In particular, note the style argument. Cheers, Bert Gunter Genentech Nonclinical Biostatistics 650-467-7374 -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Elena Wilson Sent: Tuesday, March 10, 2009 3:56 PM To: jimdare; r-help at r-project.org Subject: Re: [R] 2 Simple Lattice Plot Questions With you first question, I had a similar problem when the year (in my case it was sample size) variable was numeric. Add as.factor in front of it and it should show you the actual levels... -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of jimdare Sent: Wednesday, 11 March 2009 9:48 AM To: r-help at r-project.org Subject: [R] 2 Simple Lattice Plot Questions Hi, I have created the plot below and have a few questions about changes. 1) How do I change the "Year" title of each plot so it reads from the top "2006","2007","2008","2009". 2) How do I get rid of those vertical grey bars in the title bar of each plot? I apologise for my ignorance... one of those days :( James http://www.nabble.com/file/p22445242/PLOT.jpg -- View this message in context: http://www.nabble.com/2-Simple-Lattice-Plot-Questions-tp22445242p22445242.ht ml Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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. -- Message protected by MailGuard: e-mail anti-virus, anti-spam and content filtering. http://www.mailguard.com.au/mg https://login.mailguard.com.au/report/1x1QqLdh8M/3sazYwF0XpYQ6RvoZPBdoj/2.39 8 ______________________________________________ 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.
Thanks very much. One other thing... see how the Y axis begins before 0. At first glance it appears that the 0's are actually worth something. When I use ylim=c(0,30) I get the graph I want, but the tick marks show only 5,10,15,20,25. I want them to show 0,5,10,15,20,30. Does anyone know how to change this setting? Cheers, jimdare wrote:> > Hi, > > I have created the plot below and have a few questions about changes. > > 1) How do I change the "Year" title of each plot so it reads from the top > "2006","2007","2008","2009". > 2) How do I get rid of those vertical grey bars in the title bar of each > plot? > > I apologise for my ignorance... one of those days :( > > James > > > http://www.nabble.com/file/p22445242/PLOT.jpg >-- View this message in context: http://www.nabble.com/2-Simple-Lattice-Plot-Questions-tp22445242p22447415.html Sent from the R help mailing list archive at Nabble.com.
Have you tried specifying the levels of y's you want to display, e.g. ylim=c(0,5,10,15,20,30)? -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of jimdare Sent: Wednesday, 11 March 2009 12:50 PM To: r-help at r-project.org Subject: Re: [R] 2 Simple Lattice Plot Questions Thanks very much. One other thing... see how the Y axis begins before 0. At first glance it appears that the 0's are actually worth something. When I use ylim=c(0,30) I get the graph I want, but the tick marks show only 5,10,15,20,25. I want them to show 0,5,10,15,20,30. Does anyone know how to change this setting? Cheers, jimdare wrote:> > Hi, > > I have created the plot below and have a few questions about changes. > > 1) How do I change the "Year" title of each plot so it reads from the top > "2006","2007","2008","2009". > 2) How do I get rid of those vertical grey bars in the title bar of each > plot? > > I apologise for my ignorance... one of those days :( > > James > > > http://www.nabble.com/file/p22445242/PLOT.jpg >-- View this message in context: http://www.nabble.com/2-Simple-Lattice-Plot-Questions-tp22445242p22447415.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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. -- Message protected by MailGuard: e-mail anti-virus, anti-spam and content filtering. http://www.mailguard.com.au/mg https://login.mailguard.com.au/report/1x1TEaABIw/4soNUVnBh04s1coMEHC4LA/7.998