-
Notifications
You must be signed in to change notification settings - Fork 24
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
[FR] Support shadowtext / text background #58
Comments
I like the idea, but I don't think it makes sense for us to implement as {ggfx} can do this (and more) without us having to lift a finger. library(ggfx)
#> Warning: package 'ggfx' was built under R version 4.1.1
library(geomtextpath)
#> Loading required package: ggplot2
t <- seq(5, -1, length.out = 1000) * pi
spiral <- data.frame(x = sin(t) * 1:1000,
y = cos(t) * 1:1000,
text = paste("Like a circle in a spiral,",
"like a wheel within a wheel,",
"never ending or beginning,",
"on an ever spinning reel")
)
ggplot(spiral, aes(x, y, label = text)) +
with_outer_glow(
geom_textpath(size = 7, vjust = 2, text_only = TRUE, colour = "white"),
sigma = 0, expand = 2
) +
coord_equal(xlim = c(-1500, 1500), ylim = c(-1500, 1500)) Created on 2022-01-15 by the reprex package (v2.0.1) |
A small note: once R4.2.0 comes out, it might make sense to do outlined text as it becomes part of the |
Wow thank you so much! I didn't know that the |
There are currently multiple implementations for the
geom_text
with border. For example,shadowtext
.ggrepel
also take abg.color
argument that can produce a similar effect.https://guangchuangyu.github.io/2017/11/shadow-text-effect-in-grid-and-ggplot2-graphics/
https://stackoverflow.com/questions/56798482/how-to-combine-repelling-labels-and-shadow-or-halo-text-in-ggplot2
This could be helpful for
geomtextpath
, especially whengap = FALSE
, or when plot with other geom layers.Also could help my previous problem #55 , to better separate the text and line when
vjust
is not working.Thank you so much!
The text was updated successfully, but these errors were encountered: