[Tikzdevice-bugs] Error: "TeX capacity exceeded, sorry"

Cameron Bracken cameron.bracken at gmail.com
Wed Oct 28 21:44:42 CET 2009


That code produces a text file that is 14 MB!! I have noticed that ggplot2
is not the most efficient in the way it does some of its plotting. But
anyway, we have run into this problem with complex graphics before. You need
to increase your tex capacity. See how to do that here:

http://www.latex-community.org/forum/viewtopic.php?f=45&p=19031

I was able to compile your example by setting

main_memory = 100000000

It takes a really long time though and the resulting pdf is still about 4
MB. Hope this helps.

-Cameron

--
Cameron Bracken
Graduate Research Assistant
CADSWES
University of Colorado at Boulder
cameron.bracken at colorado.edu
(707) 986-8633


On Wed, Oct 28, 2009 at 2:02 PM, Mike Lawrence <Mike.Lawrence at dal.ca> wrote:

> Hi all,
>
> Not sure if there's likely to be a work-around on this, but I'm trying
> to create a figure for a manuscript and I've encountered a  "TeX
> capacity exceeded, sorry" error when I try to render the pdf (
> system("/usr/texbin/pdflatex kappa.tex",int=T) ). I'm guessing this
> means that I don't have sufficient memory to render the pdf but I
> thought I'd double-check with the list to make sure there aren't any
> workarounds other than reducing the complexity of my figure or
> upgrading my RAM.
>
> Here's the code:
>
> library(CircStats)
> library(ggplot2)
> library(tikzDevice)
>
> #set some parameters
> circle_resolution = 1 #1=very high res, but pdflatex fails; 10=lower
> res but pdflatex succeeds
> kappa = exp(seq(0,4,length.out=10))
> x = seq(-180,180,circle_resolution)
>
> #generate data to plot as circles
> a = ldply(
>        kappa
>        , .fun = function(this_kappa){
>                d = dvm(x*pi/180,0,this_kappa)
>                d = d-min(d)
>                d = d/max(d)
>                to_return = data.frame(
>                        kappa = this_kappa
>                        , x = x
>                        , d = d
>                )
>                return(to_return)
>        }
> )
>
> #get ready to make nice facet labels
> temp = sort(unique(a$kappa))
> temp = as.character(round(temp,1))
> temp[1] = '1.0'
> temp[9] = '35.0'
>
> #make nice facet labels (this is why I'm using tikz)
> a$kappa_print = factor(a$kappa,labels=paste('$\\kappa = ',temp,'$',sep=''))
>
> #start making the plot
> p = ggplot(
>        data = a
>        , mapping = aes(
>                x = x
>                , y = factor(1)
>                , colour = d
>                , fill = d
>        )
> )+facet_wrap(~kappa_print,ncol=5,as.table=FALSE)+
> geom_bar(
>        width=1
>        ,stat='identity'
> )+scale_fill_gradient(
>        low = muted('blue')
>        , high = muted('red')
>        , space = 'Lab'
> )+scale_colour_gradient(
>        low = muted('blue')
>        , high = muted('red')
>        , space = 'Lab'
> )+scale_y_discrete(
>        name=''
>        ,breaks=100
> )+scale_x_continuous(
>        name=''
>        ,breaks=0
> )+coord_polar(
>        theta='x'
> )+opts(
>        legend.position='none'
>        , panel.grid.major = theme_blank()
>        , panel.grid.minor = theme_blank()
>        , axis.title.y = theme_blank()
>        , axis.text.y = theme_blank()
>        , axis.title.x = theme_blank()
>        , axis.text.x = theme_blank()
>        , axis.ticks = theme_blank()
> )
>
> #save using ggsave; works but can't get greek symbols in the facet
> labels, even using plotmath
> ggsave(p,file='kappa_ggsave.pdf',width = 10,height = 4.5)
>
> #save using tikz
> tikz("kappa_tikz.tex", width = 10,height = 4.5, standAlone =T)
> print(p)
> dev.off()
>
> #this next step fails when circle_resolution=1 (on my machine with 2GB RAM)
> system("/usr/texbin/pdflatex kappa_tikz.tex",int=T)
>
>
> --
> Mike Lawrence
> Graduate Student
> Department of Psychology
> Dalhousie University
>
> Looking to arrange a meeting? Check my public calendar:
> http://tr.im/mikes_public_calendar
>
> ~ Certainty is folly... I think. ~
> _______________________________________________
> Tikzdevice-bugs mailing list
> Tikzdevice-bugs at lists.r-forge.r-project.org
>
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tikzdevice-bugs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.r-forge.r-project.org/pipermail/tikzdevice-bugs/attachments/20091028/f5a83ebc/attachment-0001.htm 


More information about the Tikzdevice-bugs mailing list