Enhanced Dot Chart for LaTeX Picture Environment with epic
latexDotchart
is a translation of the dotchart3
function
for producing a vector of character strings containing LaTeX picture
environment markup that mimics dotchart3
output. The LaTeX
epic
and color
packages are required. The add
and
horizontal=FALSE
options are not available for
latexDotchart
, however.
latexDotchart(data, labels, groups=NULL, gdata=NA, xlab='', auxdata, auxgdata=NULL, auxtitle, w=4, h=4, margin, lines=TRUE, dotsize = .075, size='small', size.labels='small', size.group.labels='normalsize', ttlabels=FALSE, sort.=TRUE, xaxis=TRUE, lcolor='gray', ...)
data |
a numeric vector whose values are shown on the x-axis |
labels |
a vector of labels for each point, corresponding to
|
groups |
an optional categorical variable indicating how
|
gdata |
data values for groups, typically summaries such as group medians |
xlab |
x-axis title |
auxdata |
a vector of auxiliary data, of the same length
as the first ( |
auxgdata |
similar to |
auxtitle |
if |
w |
width of picture in inches |
h |
height of picture in inches |
margin |
a 4-vector representing, in inches, the margin to the
left of the x-axis, below the y-axis, to the right of the x-axis,
and above the y-axis. By default these are computed making educated
cases about how to accommodate |
lines |
set to |
dotsize |
diameter of filled circles, in inches, for drawing dots |
size |
size of text in picture. This and the next two arguments
are LaTeX font commands without the opening backslash, e.g.,
|
size.labels |
size of labels |
size.group.labels |
size of labels corresponding to |
ttlabels |
set to |
sort. |
set to |
xaxis |
set to |
lcolor |
color for horizontal reference lines. Default is |
... |
ignored |
Frank Harrell
Department of Biostatistics
Vanderbilt University
fh@fharrell.com
## Not run: z <- latexDotchart(c(.1,.2), c('a','bbAAb'), xlab='This Label', auxdata=c(.1,.2), auxtitle='Zcriteria') f <- '/tmp/t.tex' cat('\documentclass{article}\n\usepackage{epic,color}\n\begin{document}\n', file=f) cat(z, sep='\n', file=f, append=TRUE) cat('\end{document}\n', file=f, append=TRUE) set.seed(135) maj <- factor(c(rep('North',13),rep('South',13))) g <- paste('Category',rep(letters[1:13],2)) n <- sample(1:15000, 26, replace=TRUE) y1 <- runif(26) y2 <- pmax(0, y1 - runif(26, 0, .1)) z <- latexDotchart(y1, g, groups=maj, auxdata=n, auxtitle='n', xlab='Y', size.group.labels='large', ttlabels=TRUE) f <- '/tmp/t2.tex' cat('\documentclass{article}\n\usepackage{epic,color}\n\begin{document}\n\framebox{', file=f) cat(z, sep='\n', file=f, append=TRUE) cat('}\end{document}\n', file=f, append=TRUE) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.