Have to output a bunch of dense scatterplots to PDF/SVG, but don't want the filesize to bloat with thousands of symbols to draw the points?

Learn from my mistakes instead of making your own:

```r
geom_point <- function(...) {
ggrastr::rasterise(ggplot2::geom_point(...), dpi = 300)
}
```
#rstats

@teunbrand good solution! I would avoid overloading geom_point though, something like geom_point_raster would be more meaningful. I know you can still use ggplot2:: to access the original version but that is prone to unwanted confusion.

@nicolaromano There is already a `ggrastr::geom_point_rast()`. My use case was 'suddenly collaborators want *all* plots ever made for a project in PDF' for a few notebooks consisting mostly of EDA scatterplots. I did not have the patience to wrap every `geom_point()` individually :)

Follow

@teunbrand fair enough I didn't understand the use case! (And didn't know about geom_point_raster!)

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.