views:

194

answers:

2

This is not really a programming question, but I try here none the less.

I once used latex for my reports. But the people I work with needs to make small edits and do not have latex skillz. Openoffice is then the way to go. But saving ggplot images with dpi >100 makes for really ugly graphs. dpi = 600 is a no go (e.g. huge legend). So what to do?

I currently save (still via ggsave) to eps - which openoffice can import. But performance is not good at all.

Googling I found a bug for the poor eps performance in OOo, and also talk about a non-implemented svg feature. But none helps me right now.

If you work with ggplot2 and OOo - What do you do? I have been unsuccesfull with pdf conversion for some reason.

+1  A: 

If eps doesn't work for you, try a different device. For example

qplot(mpg, wt, data=mtcars)
ggsave(filename = "test.png")            % png device guessed from filename
ggsave(filename = "test.png", dpi = 600) % higher res if quality is an issue
Richie Cotton
Pertaining my comment to hadley - the problem seams to be fixed... I don't understand why though. But since the solutions that was not working, and the solution that now is working, is the same solution that you suggested - I accept your answer. Thanks.
Andreas
@Richie - Is it possible to batch-save a series of plots? It looks like `ggsave()` only accepts single files as arguments :-(
briandk
@briandk: Use a loop/ `*apply` function, e.g. `lapply(list(plot1, plot2), function(x) ggsave(plot = x))`.
Richie Cotton
@Richie: Awesome solution. I keep forgetting about the apply family. Thanks!
briandk
A: 

try http://cran.r-project.org/web/packages/odfWeave/index.html

Ricardo Pietrobon
Thanks Ricardo - for some reason I newer got odfWeave to work. Something with and xml error. Plus - I still find it out to edit in OOo. But maybe this is the way forward. + I don't know if odfweave would acctually solve the problem I was having.
Andreas