Re: [R] text plots?

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Sat 13 May 2006 - 01:50:44 EST

On 5/12/06, Robert Citek <rwcitek@alum.calberkeley.org> wrote:
>
> 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?

You could also write your own function, e.g. the following is not very sophisticated, e.g. no axes, but if you are just looking for something simple something along these lines may be sufficient:

printplot <- function(x,y, wx = 25, wy = 25, dot = "+") {
	xx <- round((wx-1) * (x - min(x)) / (max(x) - min(x))) + 1
	yy <- round((wy-1) * (y - min(y)) / (max(y) - min(y))) + 1
	slate <- matrix(" ", wx, wy)
	slate[cbind(xx,yy)] <- dot
	for(j in wy:1) cat(slate[j,], "\n", sep = "")
}
printplot(x = 1:10, y = (1:10)^2) # test

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat May 13 01:56:01 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 13 May 2006 - 02:10:07 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.