[Tikzdevice-bugs] Forward of moderated message
Charlie Sharpsteen
chuck at sharpsteen.net
Fri Nov 19 01:26:20 CET 2010
On Thu, Nov 18, 2010 at 4:02 PM,
<tikzdevice-bugs-bounces at lists.r-forge.r-project.org> wrote:
>
>
> ---------- Forwarded message ----------
> From: "Daniel Kübler" <kubler.daniel at gmail.com>
> To: tikzdevice-bugs at lists.r-forge.r-project.org
> Date: Thu, 18 Nov 2010 16:52:48 -0500
> Subject: ggplot2 problem from stackoverflow...
> Hello Charlie,
>
> Thanks very much for your help.
>
> Here's the download link: http://dl.dropbox.com/u/7752237/plot_info.Rdata
>
> With this Rdata file, I could reproduce the error mentioned at Stackoverflow.
>
> Cheers,
> Daniel
Hi Daniel,
The issue arises from the fact that ggplot2 will use "que_id" as the
title for the legend. The problem is that this string contains an
underscore, which LaTeX uses to denote subscripts, and using an
underscore is illegal outside of math mode.
When tikzDevice asks LaTeX to compute the width and height of the
legend title, LaTeX dies because of the stray underscore. The
tikzDevice gets no metrics and this causes "Error in if (width > 0)"
because the metrics code was expecting width to contain a number
instead of NULL.
I will post a response on Stackoverflow containing some strategies for
avoiding this error with the current version of the tikzDevice. We
will also be releasing a version 0.5.3 sometime in the next couple of
weeks that contains some small bugfixes. I will add some changes that
will hopefully make this issue easier to avoid along with a better
error message.
Thanks for taking the time to send me the data!
-Charlie
More information about the Tikzdevice-bugs
mailing list