I noticed that the text() command adds text to a plot. Is there a way to either make the plot blank or add text to a "blank sheet". I would like to "plot" a page that contains just text, no plot lines, labels, etc. Suggestions? Kevin [[alternative HTML version deleted]]
Sure. The simplest way is to call plot.new() directly, with no arguments. That will give you a square plot with range of 0-1 on each axis (roughly). If you want a more complex underlying plot, that's possible too. If you take a look at ?par, you'll see options for all the different components of a plot: the box around it, the axis labels, etc. Each can be set to not be drawn. (I don't know of a more efficient way.) Something like: plot(c(0, 10), c(0, 20), type="n", bty="n", xaxt="n", yaxt="n", xlab="", ylab="", main="") will do it. Sarah On Fri, Oct 21, 2011 at 8:26 PM, <rkevinburton at charter.net> wrote:> > I noticed that the text() command adds text to a plot. Is there a way to > either make the plot blank or add text to a "blank sheet". I would like > to "plot" a page that contains just text, no plot lines, labels, etc. > > Suggestions? > > Kevin >-- Sarah Goslee http://www.functionaldiversity.org
Try this, library(grid) grid.newpage() grid.text("text") HTH, baptiste On 22 October 2011 13:26, <rkevinburton at charter.net> wrote:> > I noticed that the text() command adds text to a plot. Is there a way to > either make the plot blank or add text to a "blank sheet". I would like > to "plot" a page that contains just text, no plot lines, labels, etc. > > Suggestions? > > Kevin > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > 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. >
Hi Kevin, have a look at ?textplot from the gplots-package. cheers Am 22.10.2011 02:26, schrieb rkevinburton at charter.net:> > I noticed that the text() command adds text to a plot. Is there a way to > either make the plot blank or add text to a "blank sheet". I would like > to "plot" a page that contains just text, no plot lines, labels, etc. > > Suggestions? > > Kevin > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.-- Eik Vettorazzi Institut f?r Medizinische Biometrie und Epidemiologie Universit?tsklinikum Hamburg-Eppendorf Martinistr. 52 20246 Hamburg T ++49/40/7410-58243 F ++49/40/7410-57790
Thank you. This works pretty well. I am having some trouble with the text on the left-hand side getting cut off. I have tried haling="center" with not luck. How can I make the text seem wider than it really is to avoid the truncation. It is only a few characters but still it is annoying. Thank you. -----Original Message----- From: Eik Vettorazzi [mailto:E.Vettorazzi at uke.de] Sent: Saturday, October 22, 2011 7:06 AM To: rkevinburton at charter.net Cc: r-help at r-project.org Subject: Re: [R] "Plotting" text? Hi Kevin, have a look at ?textplot from the gplots-package. cheers Am 22.10.2011 02:26, schrieb rkevinburton at charter.net:> > I noticed that the text() command adds text to a plot. Is there a way > to either make the plot blank or add text to a "blank sheet". I would > like to "plot" a page that contains just text, no plot lines, labels, etc. > > Suggestions? > > Kevin > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.-- Eik Vettorazzi Institut f?r Medizinische Biometrie und Epidemiologie Universit?tsklinikum Hamburg-Eppendorf Martinistr. 52 20246 Hamburg T ++49/40/7410-58243 F ++49/40/7410-57790
I get the following error trying to install the package:> install.packages("grid")--- Please select a CRAN mirror for use in this session --- Warning message: In getDependencies(pkgs, dependencies, available, lib) : package ?grid? is not available (for R version 2.13.2)>-----Original Message----- From: baptiste auguie [mailto:baptiste.auguie at googlemail.com] Sent: Saturday, October 22, 2011 12:46 AM To: rkevinburton at charter.net Cc: r-help at r-project.org Subject: Re: [R] "Plotting" text? Try this, library(grid) grid.newpage() grid.text("text") HTH, baptiste On 22 October 2011 13:26, <rkevinburton at charter.net> wrote:> > I noticed that the text() command adds text to a plot. Is there a way > to either make the plot blank or add text to a "blank sheet". I would > like to "plot" a page that contains just text, no plot lines, labels, etc. > > Suggestions? > > Kevin > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > 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. >
grid is an R base package that always ships with R and is not distributed in the repository of contributed packages. Uwe Ligges On 24.10.2011 14:50, Kevin Burton wrote:> I get the following error trying to install the package: > >> install.packages("grid") > --- Please select a CRAN mirror for use in this session --- > Warning message: > In getDependencies(pkgs, dependencies, available, lib) : > package ?grid? is not available (for R version 2.13.2) >> > > -----Original Message----- > From: baptiste auguie [mailto:baptiste.auguie at googlemail.com] > Sent: Saturday, October 22, 2011 12:46 AM > To: rkevinburton at charter.net > Cc: r-help at r-project.org > Subject: Re: [R] "Plotting" text? > > Try this, > > library(grid) > grid.newpage() > grid.text("text") > > HTH, > > baptiste > > On 22 October 2011 13:26,<rkevinburton at charter.net> wrote: >> >> I noticed that the text() command adds text to a plot. Is there a way >> to either make the plot blank or add text to a "blank sheet". I would >> like to "plot" a page that contains just text, no plot lines, labels, etc. >> >> Suggestions? >> >> Kevin >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> 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. >> > > ______________________________________________ > 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.
Hi Kevin, this should be read as halign="center" - so is it a typo just in your mail or in your program as well? apart from that, the rules at the bottom lines of every post on this list also apply here: what have you tried and what went wrong? Cheers Am 24.10.2011 14:48, schrieb Kevin Burton:> Thank you. This works pretty well. I am having some trouble with the text on > the left-hand side getting cut off. I have tried haling="center" with not > luck. How can I make the text seem wider than it really is to avoid the > truncation. It is only a few characters but still it is annoying. Thank you. > > -----Original Message----- > From: Eik Vettorazzi [mailto:E.Vettorazzi at uke.de] > Sent: Saturday, October 22, 2011 7:06 AM > To: rkevinburton at charter.net > Cc: r-help at r-project.org > Subject: Re: [R] "Plotting" text? > > Hi Kevin, > have a look at ?textplot from the gplots-package. > > cheers > > Am 22.10.2011 02:26, schrieb rkevinburton at charter.net: >> >> I noticed that the text() command adds text to a plot. Is there a way >> to either make the plot blank or add text to a "blank sheet". I would >> like to "plot" a page that contains just text, no plot lines, labels, etc. >> >> Suggestions? >> >> Kevin >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> 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. > > > -- > Eik Vettorazzi > Institut f?r Medizinische Biometrie und Epidemiologie Universit?tsklinikum > Hamburg-Eppendorf > > Martinistr. 52 > 20246 Hamburg > > T ++49/40/7410-58243 > F ++49/40/7410-57790 >-- Eik Vettorazzi Department of Medical Biometry and Epidemiology University Medical Center Hamburg-Eppendorf Martinistr. 52 20246 Hamburg T ++49/40/7410-58243 F ++49/40/7410-57790 -- Pflichtangaben gem?? Gesetz ?ber elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG): Universit?tsklinikum Hamburg-Eppendorf; K?rperschaft des ?ffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Guido Sauter (Vertreter des Vorsitzenden), Dr. Alexander Kirstein, Joachim Pr?l?, Prof. Dr. Dr. Uwe Koch-Gromus