Johnson, Roger W.
2009-Aug-03 00:37 UTC
[R] boxplot( ) headers with Greek letters, values, and text
Hi - I've been using the option main=bquote(paste(mu==.(mu),", ",lambda==.(lambda),", ",truncation==.(truncation),", ",N[T]==.(n))) to produce a title when using the "plot" command - a title which includes variable names (two Greek) along with their values. The above option, however, does not work within the "boxplot" command. Any suggestions on how I can produce the same title using the boxplot command? Thank you, Roger
cameron.bracken
2009-Aug-03 18:04 UTC
[R] boxplot( ) headers with Greek letters, values, and text
Johnson, Roger W. wrote:> > Any suggestions on how I can produce the same title using the boxplot > command? >If you use LaTeX you could try the tikzDevice package ( https://r-forge.r-project.org/projects/tikzdevice/ ). In that case you would use: main = paste('\\mu =',mu,', \\lambda =',lambda,', truncation =',truncation, ', N_T =',n) a full example is: tikz('myplot.tex') boxplot(rnorm(100), main = paste('\\mu =',mu,', \\lambda =',lambda,', truncation =',truncation, ', N_T =',n)) dev.off() And in a tex file: \documentclass{article} \usepackage{tikz} \begin{document} \begin{figure} \centering \input{myplot.tex} \caption{} \end{figure} \end{document} and the symbols would get typeset by latex. - Cameron P.S. I am one of the authors of this package, so this post is a bit self serving but we just released a beta version and are trying to get the word out. -- View this message in context: http://www.nabble.com/boxplot%28-%29-headers-with-Greek-letters%2C-values%2C-and-text-tp24785201p24795386.html Sent from the R help mailing list archive at Nabble.com.
Gabor Grothendieck
2009-Aug-03 18:29 UTC
[R] boxplot( ) headers with Greek letters, values, and text
Try this: boxplot(1:5, main = bquote(mu == .(mu) * "," ~ lambda == .(lambda) * "," ~ trunction == .(truncation) * "," ~ N[T] == .(n))) On Sun, Aug 2, 2009 at 8:37 PM, Johnson, Roger W.<Roger.Johnson at sdsmt.edu> wrote:> Hi - > > I've been using the option > > main=bquote(paste(mu==.(mu),", ",lambda==.(lambda),", ",truncation==.(truncation),", ",N[T]==.(n))) > > to produce a title when using the "plot" command - a title which includes variable names (two Greek) > along with their values. > > The above option, however, does not work within the "boxplot" command. > > Any suggestions on how I can produce the same title using the boxplot command? > > Thank you, > > Roger > ______________________________________________ > 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. >