Skip to content

Plotting an Underbrace in R

6 messages · Ben Bolker, Baptiste Auguie, Michael McAssey +1 more

#
Michael McAssey <mpmcassey <at> gmail.com> writes:
Does

<http://yihui.name/en/wp-content/uploads/2010/02/lyx-pgfsweave-demo.pdf>

 help at all?
#
Ben,

This example of pgfSweave looks like it would address my problem.? I
installed this package, but I cannot determine how to use it to make R
convert LaTeX commands into mathematical symbols on an R plot.? The
documentation does not seem to address this.? I tried to mimic the
example from Yihui Xie that you provided but R only puts the LaTeX
code on my plot without converting it.? That is, if in the R GUI I
have:
then in the plot the y-axis label is $Y=\beta_0 + \beta_1 x +
\epsilon$ rather than what I want.  I can't find any useful help on
Google.  Any further suggestions?

Thanks.

Michael
On Thu, Apr 14, 2011 at 11:22 PM, Ben Bolker <bbolker at gmail.com> wrote:
--
Michael P. McAssey, Ph.D.
Statistics for Life Sciences, Department of Mathematics
Faculty of Sciences, Vrije Universiteit Amsterdam
De Boelelaan 1081a, 1081 HV Amsterdam, The Netherlands
Office: S-230, W&N building
Tel: +31 (0)20 598 7724
Fax: +31 (0)20 598 7653
Mobile: +31 (0)62 113 8600
http://www.few.vu.nl/~mmy700/
#
Hi,

Through pgfSweave you can use the tikz device, which is the one that
can interpret Latex code (package tikzDevice). I would start with a
minimal self-contained plot with this function. see ?tikz for
examples.

HTH,

baptiste
On 15 April 2011 20:03, Michael McAssey <mpmcassey at gmail.com> wrote:
#
Baptiste,

Thank you.  The examples in the documentation for tikz helped me solve
this problem, and give me a good tool for future plots.  I only need
to figure out how to incorporate LaTeX packages like amssymb so that I
can use \mathbb{} to put the real numbers symbol in my plot.

Regards,

Michael

On Fri, Apr 15, 2011 at 10:48 AM, baptiste auguie
<baptiste.auguie at googlemail.com> wrote:

  
    
15 days later
#
Oh, I did not see this post and I just saw your message in my blog.
Anyway, here is a solution for other people's future reference:
http://yihui.name/en/2011/04/produce-authentic-math-formulas-in-r-graphics/

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA
On Fri, Apr 15, 2011 at 4:42 AM, Michael McAssey <mpmcassey at gmail.com> wrote: