Use `rasterise()` instead of legacy wrapper functions
mainggrastr provides a modern, preferred way to rasterize specific layers in ggplot2 using the rasterise() function. This approach is superior to the legacy wrapper functions because it allows you to wrap any standard ggplot2 geom (like geom_point(), geom_tile(), or geom_beeswarm()) and control the rasterization parameters without needing a specific _rast version of that geom.
Using rasterise() ensures that only the specified layer is rasterized, while other elements like text, axes, and labels remain in vector format, preventing the loss of quality in text elements while significantly reducing file size for plots with many points.
```r
# Preferred modern approach
gg_rasterized <- gg + rasterise(geom_point(), dpi = 300, scale = 1)
```埋