Isn't the behavior Daniel described how ggplot2 works? Certainly it's how ggsave works.
-- John On Feb 7, 2014, at 9:41 AM, G. Patrick Mauroy <[email protected]> wrote: > Ouch! > In my opinion, this may be a major stumbling block for Julia adoption. > I, and I am sure many, find it typical routine to load data, crunch, make a > variety of graphical views (sometimes very many), export them to files in an > organized way for analysis and sharing a story line. > With many such plots, one file per plot could become quickly messy, harder to > manage. > > I suppose then a workaround would be to organize plots in sub-directories, as > PNG pictures for ease of scrolling through them. Perhaps not that bad after > all thinking about it. I suppose I can live with that. > > I still believe it would be a good idea if support to have multiple plots in > one pdf would be added somehow, very handy! > > Thanks for the info, it saves me some search time. > > On Friday, February 7, 2014 12:02:28 PM UTC-5, Daniel Jones wrote: > There's not a way to put them on separate pdf pages, but you can stack them > and output them to the same pdf like: > > using Gadfly > x = [1,2,3] > plot1 = plot(x = x, y = x + 3) > plot2 = plot(x = x, y = 2 * x + 1) > draw(PDF("plotJ.pdf", 6inch, 6inch), vstack(plot1, plot2)) > > > On Friday, February 7, 2014 8:35:57 AM UTC-8, G. Patrick Mauroy wrote: > Just starting taking a look at Julia. I have seen examples on how to send a > plot to a file. But I have not stumbled upon one example as yet to export > multiple plots to the same file, say pdf. > Can someone please point me in the right direction? > > # R example of what I would like to do. > x = 1:3 > pdf(file = "plotR.pdf") > plot(x = x, y = x + 3) > plot(x = x, y = 2 * x + 1) > dev.off() > > # My first Julia attempt. > using Gadfly > x = [1,2,3] > plot1 = plot(x = x, y = x + 3) > plot2 = plot(x = x, y = 2 * x + 1) > draw(PDF("plotJ.pdf", 6inch, 3inch), plot1) > draw(PDF("plotJ.pdf", 6inch, 3inch), plot2) > > Pb: plot2 overrides plot1, so only plot2 in plotJ.pdf. > > To be clear, in this example, I want plot1 & plot2 in two distinct > plots/pages -- as opposed to merge both graphs into one plot. > > Thanks.
