Is there a way to do text plots in R? I'd like to do some simple XY plots in R with the output in text (ascii). For example, with gnuplot I can do the following: echo 'set terminal dumb ; plot sin(x)' | gnuplot To generate a simple sin wave. Since I connect to a remote Linux machine using SSH, being able to generate a rough idea of what a plot will look like in text would be of benefit. I've looked at ?plot, ? par, and ?plot.default but didn't see anything obvious. Regards, - Robert http://www.cwelug.org/downloads Help others get OpenSource software. Distribute FLOSS for Windows, Linux, *BSD, and MacOS X with BitTorrent
You could transfer the data to MacAnova and do it there. There is an example here: http://tolstoy.newcastle.edu.au/R/help/03b/7504.html Type help in MacAnova to get info on other graphics functions. On 5/12/06, Robert Citek <rwcitek at alum.calberkeley.org> wrote:> > Is there a way to do text plots in R? > > I'd like to do some simple XY plots in R with the output in text > (ascii). For example, with gnuplot I can do the following: > > echo 'set terminal dumb ; plot sin(x)' | gnuplot > > To generate a simple sin wave. Since I connect to a remote Linux > machine using SSH, being able to generate a rough idea of what a plot > will look like in text would be of benefit. I've looked at ?plot, ? > par, and ?plot.default but didn't see anything obvious. > > Regards, > - Robert > http://www.cwelug.org/downloads > Help others get OpenSource software. Distribute FLOSS > for Windows, Linux, *BSD, and MacOS X with BitTorrent > > ______________________________________________ > R-help at 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 >
[Robert Citek]>Is there a way to do text plots in R? I'd like to do some simple XY >plots in R with the output in text (ascii). Since I connect to >a remote Linux machine using SSH, being able to generate a rough idea >of what a plot will look like in text would be of benefit.Note that it is easy with SSH to open a graphics connection, you may use "ssh -X" to force it. Than, R will show you nice graphics even if run remotely.>For example, with gnuplot I can do the following: > echo 'set terminal dumb ; plot sin(x)' | gnuplot >to generate a simple sin wave. Regards,Amusing for me that you mention this: I wrote that code, many years ago. Despite gnuplot was aiming higher graphic output quality on average, my contribution was readily accepted, and considered useful. While it is possible to attach images within an email, rough graphics is sometimes simpler and sufficient. I do not know how easy (or not) it would be writing a dumb device for R, but I wish that if someone ever contributes it, it will be accepted by the core team. -- Fran?ois Pinard http://pinard.progiciels-bpi.ca
This may not help, but if you have S-Plus on the machine you're connecting to, it has a printer() device for this sort of thing. Robert Citek wrote:> Is there a way to do text plots in R? > > I'd like to do some simple XY plots in R with the output in text > (ascii). For example, with gnuplot I can do the following: > > echo 'set terminal dumb ; plot sin(x)' | gnuplot > > To generate a simple sin wave. Since I connect to a remote Linux > machine using SSH, being able to generate a rough idea of what a plot > will look like in text would be of benefit. I've looked at ?plot, ? > par, and ?plot.default but didn't see anything obvious. > > Regards, > - Robert-- Kevin E. Thorpe Biostatistician/Trialist, Knowledge Translation Program Assistant Professor, Department of Public Health Sciences Faculty of Medicine, University of Toronto email: kevin.thorpe at utoronto.ca Tel: 416.946.8081 Fax: 416.946.3297
On May 12, 2006, at 9:57 AM, Robert Citek wrote:> Is there a way to do text plots in R?From the responses so far, the short answer appears to be, no. That appears to leave two options for viewing plots on a remote machine: 1) use X11 forwarding (requires an X11 server and that X11 forwarding be enabled), although the plots won't be in text. 2) output the data to a file and use another program to plot the data as text, e.g. MacAnova or gnuplot. Is that a fair summary? Regards, - Robert http://www.cwelug.org/downloads Help others get OpenSource software. Distribute FLOSS for Windows, Linux, *BSD, and MacOS X with BitTorrent
On Fri, 12 May 2006, Robert Citek wrote:> Is there a way to do text plots in R?Not that I know of. I last used such plots ca 1985, long before R was conceived of and when student terminal rooms had 80*24 VDUs.> I'd like to do some simple XY plots in R with the output in text > (ascii). For example, with gnuplot I can do the following: > > echo 'set terminal dumb ; plot sin(x)' | gnuplot > > To generate a simple sin wave. Since I connect to a remote Linux > machine using SSH, being able to generate a rough idea of what a plot > will look like in text would be of benefit.I routinely use a Linux box remotely, but either view on an X connection (e.g. from my home to my office, and I have even done internationally), or write PDF and remote access the file. I even see people using Windows Terminal Services remotely over quite slow lines.> I've looked at ?plot, ?par, and ?plot.default but didn't see anything > obvious.You need to look at devices (e.g. ?Devices), not how to plot on a device. BTW, devices do not need to be part of R so anyone could write such a device and contribute it (in a package). -- Brian D. Ripley, ripley at 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, UK Fax: +44 1865 272595
There are some very basic interface functions to gnuplot in the TeachingDemos package that may make option 2 below a little quicker. Or even better you could expand them to work better. The following works on a single windows machine (don't have linux or a remote machine to test with): library(TeachingDemos) x <- runif(100) y <- rnorm(100) gp.open() gp.send('set terminal dumb') gp.plot(x,y) # switch to gnuplot window to look at plot gp.close() Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at intermountainmail.org (801) 408-8111 -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Robert Citek Sent: Friday, May 12, 2006 9:35 AM To: r-help at stat.math.ethz.ch Subject: Re: [R] text plots? On May 12, 2006, at 9:57 AM, Robert Citek wrote:> Is there a way to do text plots in R?From the responses so far, the short answer appears to be, no. That appears to leave two options for viewing plots on a remote machine: 1) use X11 forwarding (requires an X11 server and that X11 forwarding be enabled), although the plots won't be in text. 2) output the data to a file and use another program to plot the data as text, e.g. MacAnova or gnuplot. Is that a fair summary? Regards, - Robert http://www.cwelug.org/downloads Help others get OpenSource software. Distribute FLOSS for Windows, Linux, *BSD, and MacOS X with BitTorrent ______________________________________________ R-help at 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