When I save a ggplot figure with data points on a mac as a .pdf, users with a PC can't see them. However, if I save them as a .png or .jpeg, users with a PC can see the points. Why is this happening? I have all of my figures saved a .pdfs...so I am trying to figure out a way to work with these pdfs
Hi, and welcome!
For future questions concerning coding, please see the FAQ: What's a reproducible example (`reprex`) and how do I create one? Using a reprex, complete with representative data will attract quicker and more answers. This question doesn't require one.
I'm on Catalina and haven't noticed this. Is it just ggplot
pdfs? Can the same PC users see pdf files produced outside of R
? Is this happening in the R
gui, command line R
and in RStudio
? Or only one.
Try using the following code
suppressPackageStartupMessages(library(dplyr))
library(ggplot2)
hull_cyl <- mtcars %>%
group_by(cyl) %>%
slice(chull(mpg, wt))
# Define the scatterplot
p <- ggplot(mtcars, aes(mpg, wt)) + geom_point(shape = 21)
# Update the plot with a fill group, and overlay the new hulls
p + aes(fill = factor(cyl)) + geom_polygon(data = hull_cyl, alpha = 0.5)
Created on 2020-03-29 by the reprex package (v0.3.0)
and see if the same results occur.
If they do, please comeback with the output of the sessionInfo()
function, which looks like below. It will help check whether there are version problems.
sessionInfo()
#> R version 3.6.2 (2019-12-12)
#> Platform: x86_64-apple-darwin15.6.0 (64-bit)
#> Running under: macOS Catalina 10.15.3
#>
#> Matrix products: default
#> BLAS: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
#>
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> loaded via a namespace (and not attached):
#> [1] compiler_3.6.2 magrittr_1.5 tools_3.6.2 htmltools_0.4.0
#> [5] yaml_2.2.1 Rcpp_1.0.4 stringi_1.4.6 rmarkdown_2.1
#> [9] highr_0.8 knitr_1.28 stringr_1.4.0 xfun_0.12
#> [13] digest_0.6.25 rlang_0.4.5 evaluate_0.14
Created on 2020-03-29 by the reprex package (v0.3.0)
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.