knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) library(ggplot2) library(ggblur)
# Quick logo generation. Borrowed heavily from Nick Tierney's Syn logo process library(magick) library(showtext) font_add_google("Racing Sans One", "gf") # pkgdown::build_site(override = list(destination = "../coolbutuseless.github.io/package/ggblur"))
img <- image_read("man/figures/white.png") hexSticker::sticker(subplot = img, s_x = 0.92, s_y = 1.2, s_width = 1.5, s_height = 0.95, package = "ggblur", p_x = 1, p_y = 1, p_color = "#223344", p_family = "gf", p_size = 9, h_size = 1.2, h_fill = "#ffffff", h_color = "#223344", filename = "man/figures/logo.png") image_read("man/figures/logo.png")
ggblur
provides geom_point_blur()
for use in ggplot
- this geom allows you
to control the blurriness of the drawn points, but is otherwise
identical to the standard geom_point()
.
geom_point_blur()
geom_point()
but now accepts blur_size
as an aestheticblur_steps
)scale_blur_size_continuous()
, scale_blur_size_discrete()
and scale_blur_size_manual()
for controlling blur_size
when used as a mapped aesthetic/stat_echo
. This
solution works across multiple geoms, but didn't allow for adjusting the
echo for individual points.Blur is simulated by keeping the original point, and drawing a sequence of larger, faded points behind it (illustrated below).
The number of
points rendered is controlled by blur_steps
and the distance to which the
blur extends beyond the edge of the original point is controlled by blur_size
.
Note: Paul Murrell has some experiments to add radial gradients to grid graphics (see his github) and if this becomes part of grid it may be a better method of simulating blur.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.