-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistency between generated pdf and png files #2407
Comments
Genrated pdf file (which contains the error) |
Any difference in rendering between graphics devices is unfortunately outside the scope of ggplot2 |
This is probably due to a bug in grid's library(grid)
png("test.png")
grid.newpage()
l <- grid.roundrect(width=.5, height=.5,
gp = gpar(col = "black", fill = "grey90", lwd = 0)
)
grid.draw(l)
dev.off()
pdf("test.pdf")
grid.newpage()
l <- grid.roundrect(width=.5, height=.5,
gp = gpar(col = "black", fill = "grey90", lwd = 0)
)
grid.draw(l)
dev.off() |
Actually, now that I look at this some more, I believe the problem is that PDF renderers often display a hairline for zero-width lines. For example, this has a visible line: pdf("test.pdf")
plot(cars, type = "l", lwd = 0)
dev.off() The reason that this hasn't been a problem with other geoms is because many of them have a default color of I suggest changing |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
I have observed an inconsistency between the generated pdf and png files in the plot below.
In the plot I insert an annotate object with the type 'label'; where the width of the black line around the label is set to zero.
This works fine when exporting to a png file.
But when I export the plot to a pdf file, the black line is still present.
The text was updated successfully, but these errors were encountered: