how to manage dpi 600 or 700 ?

1,464 views
Skip to first unread message

Serdar Neslihanoglu

unread,
Oct 19, 2015, 2:37:04 PM10/19/15
to ggplot2


Hello guys, 


How to control the dpi of export plots in pdf, eps, png ggplot ?

I mean I need 600 dpi in eps, pdf or png.


Please let me know any suggestions if any.


Regards, 

Serdar


ExportPlot <- function(gplot, filename, width=7, height=7) {

    # Export plot in PDF and EPS.

    # Notice that A4: width=11.69, height=8.27

    ggsave(paste(filename, '.pdf', sep=""), gplot, width = width, height = height)

    postscript(file = paste(filename, '.eps', sep=""), width = width, height = height)

    print(gplot)

    dev.off()

    png(file = paste(filename, '.png', sep=""), width = width * 100, height = height * 100)

    print(gplot)

    dev.off()

}

Roman Luštrik

unread,
Oct 19, 2015, 2:54:19 PM10/19/15
to Serdar Neslihanoglu, ggplot2
DPI applies to raster formats only, which eps and pdf are not. png is a good format to start, and if you use`ggplot2::ggsave`, there's a `dpi` argument.

Cheers,
Roman

--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
 
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
In God we trust, all others bring data.

Serdar Neslihanoglu

unread,
Oct 19, 2015, 2:55:54 PM10/19/15
to Roman Luštrik, ggplot2
But I need at least 600 dpi eps format plots for journal publication. How can ı do that?

Regards,
Serdar

Doug Mitarotonda

unread,
Oct 19, 2015, 2:56:55 PM10/19/15
to Serdar Neslihanoglu, ggplot2
`ggsave` has a `dpi` argument and the others have a `res` argument.


Serdar Neslihanoglu

unread,
Oct 19, 2015, 3:02:39 PM10/19/15
to Doug Mitarotonda, ggplot2
should be like that ?

ggsave(paste(filename'.eps'sep=""), gplotwidth = widthheight = height, dpi=600

?

Regards,
Serdar

Brandon Hurr

unread,
Oct 19, 2015, 3:12:19 PM10/19/15
to Serdar Neslihanoglu, Doug Mitarotonda, ggplot2
An eps file is more like a set of instructions to draw something at infinite possible resolutions. 

The dpi setting will be ignored in ggsave because it doesn't make sense. 

require(ggplot2)
qplot(1:10, 1:10) #about the only time I approve of using qplot()
ggsave("testepsdpi.eps", dpi=600)
ggsave("testeps.eps")

They are quite literally the same file. 

I would just submit the eps output and be happy with it. 
testeps.eps
testepsdpi.eps

Serdar Neslihanoglu

unread,
Oct 19, 2015, 3:14:36 PM10/19/15
to Brandon Hurr, Doug Mitarotonda, ggplot2
how can see the dpi of eps format, u know that I need for journal publication. 

Regards,
Serdar

Doug Mitarotonda

unread,
Oct 19, 2015, 3:19:14 PM10/19/15
to Serdar Neslihanoglu, Brandon Hurr, ggplot2
Sorry, I read your post too quickly and just noted where you can set dpi (for rasters). As others said, your format is vectorized, so I typically use the height and width to control size. Otherwise, if the file size is too big, then I use a jpeg at a particular dpi.

Serdar Neslihanoglu

unread,
Oct 19, 2015, 3:26:02 PM10/19/15
to Doug Mitarotonda, Brandon Hurr, ggplot2
I understood that ı could not manage dpi for eps and ggplot ignore the dpi for eps. I do not understand why always journal ask me dpi of eps ? Try tiff instead of eps, but file size is too large :(

Regards,
Serdar

Adriano Fantini

unread,
Oct 19, 2015, 3:31:08 PM10/19/15
to Serdar Neslihanoglu, Doug Mitarotonda, ggplot2
EPS, as PDF, is a vector format, it makes no sense to speak of "DPI", as it has virtually infinite resolution. You can embed raster images inside the EPS, and those should be the resolution required by the publisher, but otherwise a simple EPS should not require any additional resolution settings.

Adriano Fantini

unread,
Oct 19, 2015, 3:35:17 PM10/19/15
to Serdar Neslihanoglu, Doug Mitarotonda, Brandon Hurr, ggplot2
This is a problem of the journal, not yours. Just provide the EPS. They probably mean:

provide us with an EPS, and if it contains embedded images, those should be of 300 (or whatever) DPI.

Brandon Hurr

unread,
Oct 19, 2015, 3:36:29 PM10/19/15
to Adriano Fantini, Serdar Neslihanoglu, Doug Mitarotonda, ggplot2
I agree with this advice. 

Zack Weinberg

unread,
Oct 19, 2015, 3:41:58 PM10/19/15
to ggplot2, Serdar Neslihanoglu
The journal could also be concerned with fonts being either illegibly
tiny or visibly pixelated. A proper vector font, scaled to a
reasonable size for the ultimate rendering, won't have either problem,
but if I had a nickel for every paper I've read where the chart labels
were messed up that way...

Beaulieu, Jake

unread,
Oct 19, 2015, 4:11:29 PM10/19/15
to Serdar Neslihanoglu, Doug Mitarotonda, Brandon Hurr, ggplot2

You can reduce the .tiff file size using the compression arguments.  Many journals require .tiff images to be LZW compressed.

Beaulieu, Jake

unread,
Oct 19, 2015, 4:18:42 PM10/19/15
to Serdar Neslihanoglu, Doug Mitarotonda, Brandon Hurr, ggplot2

Here is a reproducible example using the compression argument:

 

# CREATE EXAMPLE PLOT

 

library(ggplot2)  # graphics library

data(iris)  # Load data

 

p <- ggplot(iris, aes(Sepal.Length, Sepal.Width)) + geom_point()

p

 

# SAVE AS HIGH RESOLUTION RASTER (.tiff)

# Can be embeded in Word or saved as standalone file

ggsave("iris.tiff",

       p,

       units="in",

       width=3.25,   #1 column

       height=3.25,

       dpi=1200,   # ES&T. 300-600 at PLOS One,

       compression = "lzw",  # PLOS One 44MB w/out compression, 221KB w/compression

        family="Arial")  # ggplot default.  Could set to others depending on journal

 

From: ggp...@googlegroups.com [mailto:ggp...@googlegroups.com] On Behalf Of Serdar Neslihanoglu
Sent: Monday, October 19, 2015 3:26 PM
To: Doug Mitarotonda <dougmit...@gmail.com>
Cc: Brandon Hurr <brando...@gmail.com>; ggplot2 <ggp...@googlegroups.com>
Subject: Re: how to manage dpi 600 or 700 ?

 

I understood that ı could not manage dpi for eps and ggplot ignore the dpi for eps. I do not understand why always journal ask me dpi of eps ? Try tiff instead of eps, but file size is too large :(

Felix Lankester

unread,
Oct 21, 2015, 10:57:20 AM10/21/15
to Beaulieu, Jake, Serdar Neslihanoglu, Doug Mitarotonda, Brandon Hurr, ggplot2
This is really useful, thank you Jake.

However when I run your code on a plot I need to submit to PLoS there is no compression and the plot remains 60mb.  

Any ideas why? 

I attach a MRE of my data below (apologies for size of data but it should work if you paste it all in).

Thanks
Felix

MERGE <- structure(list(Village = structure(1:62, .Label = c("Balili", 
                                                          "Bonchugu", "Bukore", "Bunda mjini", "Bunda stoo", "Burunga", 
                                                          "Bwitengi", "Changuge", "Hunyari", "Iharara", "Kebosongo", "Kegonga", 
                                                          "Kenokwe", "Kibeyo", "Kihumbu", "Kiloreli", "Kisangura", "Kitaramaka", 
                                                          "Kitembere", "Kitunguruma", "Kono", "Koreri", "Kunzugu", "Kurusanga", 
                                                          "Kyambahi", "Ligamba A", "Ligamba B", "Manyamanyama", "Marasomonche", 
                                                          "Mariwanda", "Matare", "Mbalibali", "Mbirikiri", "Mbiso", "Mcharo", 
                                                          "Merenga", "Mihale", "Miseke", "Morotonga", "Motukeri", "Mugeta/Nyang'aranga", 
                                                          "Mugumu mjini", "Nyaburundu", "Nyakitono", "Nyamatoke", "Nyamisingisi", 
                                                          "Nyamuswa", "Nyangere", "Nyansura", "Nyatwali", "Nyiberekera", 
                                                          "Omahe", "Park Nyigoti", "Robanda", "Rwamchanga", "Salama kati", 
                                                          "Sanzate", "Sarakwa", "Sarawe", "Singisi", "Tabora B", "Tamau"
), class = "factor"), District = structure(c(1L, 2L, 1L, 1L, 
                                             1L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 2L, 2L, 
                                             2L, 2L, 1L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 1L, 2L, 
                                             1L, 2L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 
                                             2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 1L), .Label = c("Bunda", 
                                                                                                 "Serengeti"), class = "factor"), diff.x = c(171L, 43L, 22L, 58L, 
                                                                                                                                             86L, 72L, 45L, 83L, 51L, 12L, 125L, 25L, -62L, 58L, -5L, 106L, 
                                                                                                                                             80L, 106L, 37L, -47L, 31L, -52L, 43L, 4L, 50L, 37L, 36L, -7L, 
                                                                                                                                             -5L, 42L, 168L, -25L, 31L, 40L, 46L, -15L, 17L, -51L, 86L, 21L, 
                                                                                                                                             -88L, 136L, 74L, 20L, 63L, 46L, -23L, -32L, 320L, 47L, 115L, 
                                                                                                                                             44L, 37L, -15L, -62L, 82L, 55L, 28L, 19L, 44L, 61L, 114L), factor = structure(c(2L, 
                                                                                                                                                                                                                             4L, 2L, 2L, 2L, 3L, 4L, 3L, 1L, 3L, 4L, 4L, 3L, 4L, 2L, 1L, 3L, 
                                                                                                                                                                                                                             2L, 3L, 4L, 3L, 4L, 3L, 3L, 4L, 3L, 3L, 2L, 4L, 1L, 3L, 3L, 4L, 
                                                                                                                                                                                                                             3L, 3L, 4L, 1L, 4L, 4L, 3L, 4L, 4L, 3L, 3L, 2L, 3L, 1L, 3L, 1L, 
                                                                                                                                                                                                                             3L, 3L, 3L, 4L, 4L, 4L, 2L, 2L, 1L, 3L, 3L, 4L, 3L), .Label = c("b", 
                                                                                                                                                                                                                                                                                             "c", "cb", "none"), class = "factor"), incentive = structure(c(2L, 
                                                                                                                                                                                                                                                                                                                                                            1L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 
                                                                                                                                                                                                                                                                                                                                                            2L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 
                                                                                                                                                                                                                                                                                                                                                            2L, 2L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
                                                                                                                                                                                                                                                                                                                                                            2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 2L), .Label = c("n", 
                                                                                                                                                                                                                                                                                                                                                                                                                            "y"), class = "factor"), X2012.total = c(186L, 249L, 99L, 463L, 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                     302L, 216L, 177L, 85L, 194L, 181L, 124L, 98L, 283L, 125L, 162L, 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                     114L, 140L, 147L, 170L, 154L, 84L, 222L, 39L, 269L, 125L, 131L, 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                     37L, 248L, 162L, 108L, 210L, 285L, 90L, 274L, 69L, 207L, 188L, 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                     152L, 280L, 169L, 549L, 998L, 41L, 251L, 178L, 166L, 278L, 97L, 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                     201L, 56L, 311L, 171L, 147L, 88L, 201L, 112L, 244L, 68L, 126L, 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                     197L, 37L, 187L), X2013.total = c(357L, 292L, 121L, 521L, 388L, 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       288L, 222L, 168L, 245L, 193L, 249L, 123L, 221L, 183L, 157L, 220L, 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       220L, 253L, 207L, 107L, 115L, 170L, 82L, 273L, 175L, 168L, 73L, 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       241L, 157L, 150L, 378L, 260L, 121L, 314L, 115L, 192L, 205L, 101L, 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       366L, 190L, 461L, 1134L, 115L, 271L, 241L, 212L, 255L, 65L, 521L, 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       103L, 426L, 215L, 184L, 73L, 139L, 194L, 299L, 96L, 145L, 241L, 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       98L, 301L), collar = structure(c(2L, 1L, 2L, 2L, 2L, 2L, 1L, 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        2L, 2L, 2L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 1L, 2L, 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 1L, 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        2L, 2L, 2L, 2L, 2L, 1L, 2L), .Label = c("n", "y"), class = "factor"), 
diff.y = c(171L, 43L, 22L, 58L, 86L, 72L, 45L, 83L, 51L, 
           12L, 125L, 25L, -62L, 58L, -5L, 106L, 80L, 106L, 37L, -47L, 
           31L, -52L, 43L, 4L, 50L, 37L, 36L, -7L, -5L, 42L, 168L, -25L, 
           31L, 40L, 46L, -15L, 17L, -51L, 86L, 21L, -88L, 136L, 74L, 
           20L, 63L, 46L, -23L, -32L, 320L, 47L, 115L, 44L, 37L, -15L, 
           -62L, 82L, 55L, 28L, 19L, 44L, 61L, 114L)), .Names = c("Village", 
                                                                  "District", "diff.x", "factor", "incentive", "X2012.total", "X2013.total", 
                                                                  "collar", "diff.y"), row.names = c(NA, -62L), class = "data.frame")

summary(df)
names(df)
attach(df)
library(ggplot2)
library(tidyr)
library(dplyr)

# plot
p <- ggplot(MERGE, aes(incentive, diff.y))+
  geom_boxplot()+
  xlab("Incentive")+
  ylab("Difference in turn out / village")+
  scale_x_discrete(breaks=c("n", "y"), labels=c("No", "Yes"))+
  theme_bw()

# Jakes code
ggsave("incentives3.tiff",

Brandon Hurr

unread,
Oct 21, 2015, 11:49:26 AM10/21/15
to Felix Lankester, Beaulieu, Jake, Serdar Neslihanoglu, Doug Mitarotonda, ggplot2
I can confirm this behavior on my machine. It is completely ignoring the compression argument. 

I tried the same using tiff()/dev.off() and the result is exactly the same. tiff() itself appears to be ignoring the compression argument. I used the example here and also the iris dataset example. The results were the same. A 60.8 MB tiff.

> devtools::session_info()
Session info -----------------------------------------------------------------------------
 setting  value                       
 version  R version 3.2.2 (2015-08-14)
 system   x86_64, darwin13.4.0        
 ui       AQUA                        
 language (EN)                        
 collate  en_US.UTF-8                 
 tz       America/Los_Angeles         
 date     2015-10-21                  

Packages ---------------------------------------------------------------------------------
 package    * version    date       source                          
 assertthat   0.1        2013-12-06 CRAN (R 3.2.0)                  
 colorspace   1.2-6      2015-03-11 CRAN (R 3.2.0)                  
 DBI          0.3.1      2014-09-24 CRAN (R 3.2.0)                  
 devtools     1.9.0      2015-08-25 Github (hadley/devtools@76ada1d)
 digest       0.6.8      2014-12-31 CRAN (R 3.2.0)                  
 dplyr      * 0.4.3.9000 2015-10-16 Github (hadley/dplyr@0649503)   
 ggplot2    * 1.0.1.9003 2015-10-16 Github (hadley/ggplot2@864d64f) 
 gtable       0.1.2      2012-12-05 CRAN (R 3.2.0)                  
 labeling     0.3        2014-08-23 CRAN (R 3.2.0)                  
 magrittr     1.5        2014-11-22 CRAN (R 3.2.0)                  
 memoise      0.2.1      2014-04-22 CRAN (R 3.2.0)                  
 munsell      0.4.2      2013-07-11 CRAN (R 3.2.0)                  
 plyr         1.8.3.9000 2015-10-16 Github (hadley/plyr@9d8294e)    
 R6           2.1.1      2015-08-19 CRAN (R 3.2.0)                  
 Rcpp         0.12.1     2015-09-10 CRAN (R 3.2.0)                  
 scales       0.3.0.9000 2015-08-25 Github (hadley/scales@7fc502c)  
 tidyr      * 0.3.1.9000 2015-09-22 Github (hadley/tidyr@9aaaa10)  

Brandon Hurr

unread,
Oct 21, 2015, 11:53:12 AM10/21/15
to Felix Lankester, Beaulieu, Jake, Serdar Neslihanoglu, Doug Mitarotonda, ggplot2
And this would be why...

compression

the type of compression to be used. Ignored for type = "quartz".

asdf
data(iris)  # Load data
p <- ggplot(iris, aes(Sepal.Length, Sepal.Width)) + geom_point()
p
# SAVE AS HIGH RESOLUTION RASTER (.tiff)
# Can be embeded in Word or saved as standalone file
ggsave("iris.tiff",
       p,
       units="in",
       width=3.25,   #1 column
       height=3.25,
       dpi=1200,   # ES&T. 300-600 at PLOS One,
       compression = "lzw",  # PLOS One 44MB w/out compression, 221KB w/compression
       type = "Xlib", # set to cairo or Xlib (X11) to output compression
       family="Arial")  # ggplot default.  Could set to others depending on journal

Beaulieu, Jake

unread,
Oct 21, 2015, 12:03:29 PM10/21/15
to Brandon Hurr, Felix Lankester, Serdar Neslihanoglu, Doug Mitarotonda, ggplot2

Hmm, everything worked as expected on my machine using Felix’s data.  The compressed image is 137KB and the uncompressed is 43.5MB.

 

> sessionInfo()

R version 3.1.2 (2014-10-31)

Platform: x86_64-w64-mingw32/x64 (64-bit)

 

locale:

[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252  

[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          

[5] LC_TIME=English_United States.1252   

 

attached base packages:

[1] stats     graphics  grDevices utils     datasets  methods   base    

 

other attached packages:

[1] dplyr_0.4.3   ggplot2_1.0.1 sp_1.2-0    

 

loaded via a namespace (and not attached):

[1] assertthat_0.1   colorspace_1.2-6 DBI_0.3.1        digest_0.6.8     grid_3.1.2       gtable_0.1.2   

 [7] labeling_0.3     lattice_0.20-29  magrittr_1.5     MASS_7.3-35      munsell_0.4.2    parallel_3.1.2 

[13] plyr_1.8.3       proto_0.3-10     R6_2.1.1         Rcpp_0.12.1      reshape2_1.4.1   scales_0.3.0   

[19] stringi_0.5-5    stringr_1.0.0    tools_3.1.2  

Brandon Hurr

unread,
Oct 21, 2015, 12:04:15 PM10/21/15
to Beaulieu, Jake, Felix Lankester, Serdar Neslihanoglu, Doug Mitarotonda, ggplot2
He must be using a Mac. Looks like only the Quartz device is affected. 

Bryan Hanson

unread,
Oct 21, 2015, 1:31:37 PM10/21/15
to Brandon Hurr, Beaulieu, Jake, Felix Lankester, Serdar Neslihanoglu, Doug Mitarotonda, ggplot2
I haven’t followed every detail of this thread, but I did recently submit some graphics to PLOS ONE.  I’m on a Mac, did my (lattice/grid) graphics via knitr, with the following code

# This next chunk is used for PLOS ONE. Suppresed here to avoid the tiff files
#opts_chunk$set(tidy = TRUE, cache = FALSE, echo = FALSE, include = FALSE,
# fig.path = 'figures/', dev = c("pdf", "tiff"), dpi = c(300, 300),
# dev.args = list(tiff = list(compression = "lzw")),
# fig.width = 7, fig.height = 7) # default figure size is 7 x 7 inches


What I found was that this method wrote a graphic of the correct pixel dimensions, but it did not write the resolution tag in the tiff files correctly (it made it 72).  I fixed the tag by going into Inkscape and updating it.  Curiously, prior to fixing the tag, the file did  not appear to be compressed.  After fixing the tag, it did appear to be compressed.  Most likely, the tags and reality were clashing somehow.  The PLOS ONE graphics checking utility clearly only looks at the resolution tag.

This might be part of the puzzle you all are working on.

Bryan

Felix Lankester

unread,
Oct 21, 2015, 2:35:40 PM10/21/15
to Bryan Hanson, Brandon Hurr, Beaulieu, Jake, Serdar Neslihanoglu, Doug Mitarotonda, ggplot2
Hi all,

Yes I am on a Mac.  

Given this, can you advise me on whether there is any way to resolve this problem? I am not sure I fully understand Bryan's explanation below.

The instructions from PLoS NTD that I am trying to follow are:

you may submit your figures as high resolution (300-600 dpi) RGB TIFF files, within our limitations on dimensions. When submitting TIFFs, you must submit them in 8-bit RGB and save using LZW compression in order to reduce file size

Any help most appreciated.
  
Thanks to all for your time,

Felix

Brandon Hurr

unread,
Oct 21, 2015, 4:08:27 PM10/21/15
to Felix Lankester, Bryan Hanson, Beaulieu, Jake, Serdar Neslihanoglu, Doug Mitarotonda, ggplot2
I sent an email with a method using x11. You can use Cairo too. You'll have to install some things to get it to work. You just set the "type".

data(iris)  # Load data
p <- ggplot(iris, aes(Sepal.Length, Sepal.Width)) + geom_point()
p
# SAVE AS HIGH RESOLUTION RASTER (.tiff)
# Can be embeded in Word or saved as standalone file
ggsave("iris.tiff",
       p,
       units="in",
       width=3.25,   #1 column
       height=3.25,
       dpi=1200,   # ES&T. 300-600 at PLOS One,
       compression = "lzw",  # PLOS One 44MB w/out compression, 221KB w/compression
       type = "Xlib", # set to cairo or Xlib (X11) to output compression

Felix Lankester

unread,
Oct 22, 2015, 1:18:50 AM10/22/15
to Brandon Hurr, Bryan Hanson, Beaulieu, Jake, Serdar Neslihanoglu, Doug Mitarotonda, ggplot2
Sorry Brandon, I can not find that email or the instructions using x 11.  Would you be able to resend? 

Thanks

Felix Lankester

unread,
Oct 22, 2015, 8:11:13 AM10/22/15
to Brandon Hurr, Bryan Hanson, Beaulieu, Jake, Serdar Neslihanoglu, Doug Mitarotonda, ggplot2
OK worked it out.


I downloaded X11, updated my R to 3.2.2, added type = "cairo" to the ggsave call and it worked.  The tiff is now 216kb instead of 60Mb.

ggsave("box2.tiff",
       p,
       units="in",
       width=3.25,   #1 column
       height=3.25,
       dpi=600,   # ES&T. 300-600 at PLOS One,
       compression = "lzw",  # PLOS One 44MB w/out compression, 221KB w/compression
       family="Arial",  # ggplot default.  Could set to others depending on journal
       type="cairo")

Thanks to all for the help.

Felix



On 21 Oct 2015, at 23:07, Brandon Hurr <brando...@gmail.com> wrote:

Reply all
Reply to author
Forward
0 new messages