[R] Text-based graphics/plots

Greg Snow Greg.Snow at imail.org
Tue Apr 15 18:04:52 CEST 2008


When I first started using an early port of S, the main way to create
graphs was with the "printer" graphics device which created plots like
this (back then that was impressive).  S-PLUS does still have the
printer graphics device to do things like this, but I don't think that
anyone has ever implemented it for R (those with the skill don't have
the desire).  It has been discussed a couple of times in the past on
this list, but I don't think it ever went very far.

The program gnuplot has support for a dumb terminal type of plotting
that also creates this type of plot.  There is a very crude interface
between R and gnuplot in the TeachingDemos package (see ?gp.open).  One
approach would be to have R create the appropriate data (binning,
quartiles, ...) and send that to gnuplot for plotting as text (this
would require a separate download and install of gnuplot).

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
(801) 408-8111
 
 

> -----Original Message-----
> From: r-help-bounces at r-project.org 
> [mailto:r-help-bounces at r-project.org] On Behalf Of Karl Ove Hufthammer
> Sent: Tuesday, April 15, 2008 8:39 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] Text-based graphics/plots
> 
> When discussing statistics in e-mail based discussion groups, 
> or in newsgroups, it is sometimes useful to include simple, 
> text-based statistical graphics. Here is an example, a 
> histogram (only useful with a fixed-width font, obviously).
> 
> 
>                                     :.....
>                                  ..:::::::::.
>                                .:::::::::::::::
>                            ...:::::::::::::::::::
>              . . .........::::::::::::::::::::::::::.........
>         -------+---------+---------+---------+---------+---------+----
>              465       480       495       510       525       540
> 
> Other useful plots would be boxplots, scatterplots (even 
> Trellis-like, with multiple panels), line plots, and perhaps 
> even levelplots.
> 
> Does there exist a package containing such functions, or 
> perhaps a text-based output device?
> 
> I already know about the 'stem' function, which is very 
> nicely implemented, BTW. Here is some sample output (normal 
> distribution, with decimal point at '|').
> 
>   46 | 8
>   47 | 123799
>   48 | 01222234456
>   49 | 001222333444678
>   50 | 1233334457788
>   51 | 00022556667778999
>   52 | 0112223
>   53 | 79
>   54 | 049
> 
> --
> Karl Ove Hufthammer
> 
> ______________________________________________
> 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.
> 



More information about the R-help mailing list