Skip to content

Repel option for type_text()? #318

@grantmcdermott

Description

@grantmcdermott

(Aside: it would be cool if we could support some kind of repel / spread functionality in type_text().)

Originally posted by @grantmcdermott in #310

For inspiration, I recently came across this nice example using the textplot() function from the wordcloud package. The core functionality looks pretty straightforward, though we would obviously need to credit and/or check licensing restrictions.

library(wordcloud)
#> Loading required package: RColorBrewer

mtcars2 = transform(mtcars, make = row.names(mtcars))

with(mtcars2, textplot(wt, mpg, words = make))

# bump axes limits to catch edge labels
with(mtcars2, textplot(wt, mpg, words = make,
                       xlim = range(wt)*c(0.96, 1.04),
                       ylim = range(mpg)*c(0.96, 1.04)))

Created on 2025-02-16 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions