it is my understanding that the size argument of ggplot2 geoms is
converted to the cex argument of grid graphics before rendering. So if
you specify the size with annotate() it should work, irrespective of
the device (otherwise it's a bug in the device).
HTH,
baptiste
On Thu, Feb 11, 2010 at 12:32 AM, Jonathan Christensen
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> To post to this group, send email to ggp...@googlegroups.com
> To unsubscribe from this group, send email to
> ggplot2+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/ggplot2
I've run into several issues with text sizing in graphics with tikz,
using tikzdevice to auto-generate them. I started a question on
stackoverflow and some great help is coming. Join in and if anyone
else from the list has any thoughts all help is greatly appreciated.
Best regards,
Jay
On Feb 10, 6:32 pm, Jonathan Christensen <dzhona...@gmail.com> wrote:
> Hello again,
>
> I figured the first one out (the text was regular font weight, but was
> written over itself several times, giving it the appearance of being bold),
> but the second is still up in the air. From what I understand, tikzDevice is
> supposed to respect the cex parameter, at least applied to viewports. I
> tried using the cex parameter instead of size= in geom_text, but no luck.
> Does anybody here (I understand from previous posts that at least some of
> the list members use tikzDevice) happen to know how to change the font size
> of a geom_text annotation using ggplot and tikzDevice?
>
> Thanks,
>
> Jonathan Christensen
>
> On Tue, Feb 9, 2010 at 10:22 PM, Jonathan Christensen
> <dzhona...@gmail.com>wrote:
>
>
>
> > Hello all,
>
> > I'm sure there's a fairly simple answer to the first one, but I've been
> > unable to find one in the book or the archives. I have a plot annotated with
> > geom_text, but the font appears to be bold. Is there some way to change it
> > to regular font weight?
>
> > My second questions is somewhat more obscure. I've been experimenting with
> > using ggplot2 in combination with the tikzDevice package. However,
> > tikzDevice seems to ignore the font size I specify in ggplot2. Does anybody
> > happen to know how to fix this?
>
> > Thanks,
>
> > Jonathan Christensen- Hide quoted text -
>
> - Show quoted text -
From some of the help I've recevied on stackoverflow:
\begin{tikzpicture}[font=\scriptsize]
\draw (0,0) rectangle (1,1) -- +(-1,-1);
\node(text) at (0.5,0.5) {Text};
\end{tikzpicture}
or
or setting the option \tikzset{font=\scriptsize}
Do either of these work for you? You can for example genereate the
tikz file with the barebones option and then wrap then:
\begin{tikzpicture}[font=\scriptsize]
\input{my_graph}
\end{tikzpicture}
Another bit of help from stackoverflow on my first question yielded
the answer:
\begin{tikzpicture}
\tikzstyle{every node}=[font=\small]
\end{tikzpicture}
I'm still struggling with my case which is an issue with the scaling
of the images nad that effect on font size in tikzpictures.
Hope that helps.
Jay
> <bapt4...@googlemail.com>wrote:
>
>
>
> > Hi,
>
> > it is my understanding that the size argument of ggplot2 geoms is
> > converted to the cex argument of grid graphics before rendering. So if
> > you specify the size with annotate() it should work, irrespective of
> > the device (otherwise it's a bug in the device).
>
> > HTH,
>
> > baptiste
>
> > On Thu, Feb 11, 2010 at 12:32 AM, Jonathan Christensen
> > <dzhona...@gmail.com> wrote:
> > > Hello again,
>
> > > I figured the first one out (the text was regular font weight, but was
> > > written over itself several times, giving it the appearance of being
> > bold),
> > > but the second is still up in the air. From what I understand, tikzDevice
> > is
> > > supposed to respect the cex parameter, at least applied to viewports. I
> > > tried using the cex parameter instead of size= in geom_text, but no luck.
> > > Does anybody here (I understand from previous posts that at least some of
> > > the list members use tikzDevice) happen to know how to change the font
> > size
> > > of a geom_text annotation using ggplot and tikzDevice?
>
> > > Thanks,
>
> > > Jonathan Christensen
>
> > > On Tue, Feb 9, 2010 at 10:22 PM, Jonathan Christensen <
> > dzhona...@gmail.com>
> > > wrote:
>
> > >> Hello all,
>
> > >> I'm sure there's a fairly simple answer to the first one, but I've been
> > >> unable to find one in the book or the archives. I have a plot annotated
> > with
> > >> geom_text, but the font appears to be bold. Is there some way to change
> > it
> > >> to regular font weight?
>
> > >> My second questions is somewhat more obscure. I've been experimenting
> > with
> > >> using ggplot2 in combination with the tikzDevice package. However,
> > >> tikzDevice seems to ignore the font size I specify in ggplot2. Does
> > anybody
> > >> happen to know how to fix this?
>
> > >> Thanks,
>
Best,
baptiste
On Thu, Feb 11, 2010 at 8:32 PM, Jonathan Christensen