Provides a function to produce rudimentary ascii graphics
directly in the terminal window.
txtplot provides the basic plotting function of two numeric
vectors. All other functions below are based on this. txtcurve is a text based equivalent of the curve function txtdensity is a text based density estimation function based on the
density function txtacf is a text based equivalent of the acf function
and based on the acf function. txtbarchart is a text based barplot and plots the
relative frequences of the occurences of the different levels of a
factor (in percent)
numeric containing the x-values to plot (for txtbarchart this
needs to be of class factor). NA, NaN are removed for
plotting. Infinities cause an error
y
numeric containing the x-values to plot (needs to be of the same
length as x). If NULL the numeric x is plotted against
1:length(x). NA, NaN are removed for plotting. Infinities
cause an error
pch
Plotting symbol
width, height
Width and height of the plots in points
xlab, ylab
labels for x and y axis
xlim, ylim
limits for x and y axis in plot, if equal to NULL automatically
determined from x and y.
expr
An expression to plot (containing x)
from,to
Defines boundaries of plotting region for expr in txtcurve
n
integer specifying the number of x values between from and to
lag.max, type, na.action, demean
arguments for call of acf function, see ?acf for details
Note
Due to rounding to a relatively crude grid results can only be
approximate! The equally spaced axis ticks, for example, may be
non-equally spaced in the plot.
Due to the crude grid also there might be several points per pixel.
The function uses the same plotting symbol no matter how many points
coincide on one pixel
Author(s)
Bjoern Bornkamp
See Also
txtboxplot
Examples
## basic plotting function
require(stats)
txtplot(cars[,1], cars[,2])
## can include axis labels when desired
txtplot(cars[,1], cars[,2], xlab = "speed", ylab = "distance")
## text based density plot
txtdensity(rnorm(500))
## text based plotting of functions
txtcurve(x/(x+1), 0, 4, xlab = "Emax model")
## text based acf
txtacf(rnorm(100))
## text based barchart
x <- factor(c("orange", "orange", "red", "green", "green", "red",
"yellow", "purple", "purple", "orange"))
txtbarchart(x)