How to prevent Inkscape
from adding extra circles to geom_point()
dots when using alpha
(transparency) when importing a ggplot
figure in .pdf
format?
ggplot(mtcars,aes(wt,mpg)) + geom_point(alpha=0.5)
ggsave('inkscape_bug.pdf')
I get these perfectly smooth semi-transparent circles (zoomed screenshot of resulting .pdf
file):
But when I export to Inkscape
, in addition to the semi-transparent full circles also appear smaller and darker hollow circles on top:
Tried: This is probably a duplicate (I can't believe no one else has had this problem before) but I can't find the right keywords to find the correct threads. The only thing I can find is to add useDingbats=FALSE
, but even that doesn't fix this issue.
I also tried changing the options when importing to Inkscape
(Popper/Cairo import
, Internal import
, [unchecked] Replace PDF fonts by closest-named installed fonts
and Embed images
), to no avail. Interestingly, I get the same result directly (without exporting to Inkscape
or any other software) if I save as .svg
instead of .pdf
. Weird isn't it?
Question: 1) Why does it do that? 2) How to prevent it?
Use shape = 16
in your geom_point. The default ggplot point shape is 19, which has a border.