ggsave saves blurred pdf on mac osx mavericks

902 views
Skip to first unread message

Simone Gabbriellini

unread,
Feb 7, 2014, 7:02:27 AM2/7/14
to ggp...@googlegroups.com
Dear all,

I am facing an issue trying to ggsave my plots, which are rendered perfectly on screen. However, when I try to ggsave to pdf, I have a strange result: axes, title and legend are crispy clear, but the main area of the plot is blurred like in the attached file... I am on Mac osx 10.9.1 with R 3.0.2 and ggplot2 0.9.3.1

I use this code to plot and save:

ggplot(tdm, aes(x = Var2, y = Var1, fill = factor(value))) +

    labs(x = "Cost", y = "Benefit", fill = "Value", title="10 nodes, den=0.7") +

    geom_raster() +

    scale_fill_manual("Legend", limits = 0:9, breaks = breaks, values = col, labels=labels) +

    theme(plot.background = element_rect(fill = "grey90"),

          legend.background = element_rect(fill = "grey90")) +

    scale_x_continuous(expand = c(0, 0)) +

    scale_y_continuous(expand = c(0, 0))

ggsave("experimental results/10-0.7.pdf")


Any advice more than welcome!

best regards,
Simone
10-0.7.pdf

Brandon Hurr

unread,
Feb 7, 2014, 8:50:35 AM2/7/14
to Simone Gabbriellini, ggplot2
Your attachment does not look blurry to me on gDrive or in preview (Mac). 

The blocks are clear and crisp. 

Could you take a screen shot? 

B


--
--
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/groups/opt_out.

baptiste auguie

unread,
Feb 7, 2014, 8:52:02 AM2/7/14
to Simone Gabbriellini, ggplot2
Hi,

My guess is that your pdf viewer does some interpolation of the raster. Preview and Adobe Reader have options to turn this off.

HTH,

b.


--

Dianne Cook

unread,
Feb 7, 2014, 8:52:00 AM2/7/14
to Simone Gabbriellini, ggp...@googlegroups.com
Simone,

I don’t have a problem with this plot. Same system set up, Suspect it is your geom_raster?

cheers,
Di

> library(ggplot2)
> qplot(x, y, order=order, group=group, data=oz_all, geom="polygon", 
+       fill=AREA_SQKM) + theme_bw()
> ggsave("tmp.pdf")
Saving 11.2 x 6.15 in image

tmp.pdf

Simone Gabbriellini

unread,
Feb 7, 2014, 9:13:22 AM2/7/14
to Brandon Hurr, ggplot2
thanks for the reply, here's the screenshot attached

I don't know why this happens, if the problem is my raster_geom()
where should I look for some advices?

Best,
Simone
--
-----------------------------------------------------------------

Simone Gabbriellini, PhD

Post-doctoral Researcher
ANR founded research project "DIFFCERAM"
GEMASS, CNRS & Paris-Sorbonne.

mobile: +39 340 39 75 626
email: simone.ga...@cnrs.fr
Schermata 2014-02-07 alle 15.11.56.png

baptiste auguie

unread,
Feb 7, 2014, 9:20:15 AM2/7/14
to Simone Gabbriellini, ggplot2
Inline images 2Inline images 1


On 7 February 2014 11:13, Simone Gabbriellini <simone.ga...@gmail.com> wrote:
thanks for the reply, here's the screenshot attached

I don't know why this happens, if the problem is my raster_geom()
where should I look for some advices?


pdf viewer preferences?
Screen Shot 2014-02-07 at 11.18.25 AM.png
Screen Shot 2014-02-07 at 11.18.34 AM.png

Simone Gabbriellini

unread,
Feb 7, 2014, 9:23:16 AM2/7/14
to baptiste auguie, ggplot2
wow, thanks a lot, the Italian translation of this property is something so absurd and meaningless I would have never find it out by myself.

best,
Simone
Screen Shot 2014-02-07 at 11.18.25 AM.png
Screen Shot 2014-02-07 at 11.18.34 AM.png

Maarten Slagter

unread,
Aug 14, 2018, 5:27:10 AM8/14/18
to ggplot2
I'm experiencing the same issue in Preview version 10.0, Mac OS 10.13.6 (High Sierra). Unfortunately, this option in the settings is not present anymore. Is there any way of encoding the option to not smooth right in the pdf itself?
Cheers, Maarten

Maarten Slagter

unread,
Aug 14, 2018, 5:39:35 AM8/14/18
to ggplot2
Using geom_tile() rather than geom_raster() did the trick for me :)
-M
Reply all
Reply to author
Forward
0 new messages