On 5/12/06, Robert Citek <[EMAIL PROTECTED]> 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

Reply via email to