Search code examples
pythonrplotscatter-plot

How to make scatter plots similar to the one in the paper "Get me off Your F****** Mailing List"?


This is a serious question. Please do not take it as a joke.

This is a scatter plot from an infamous paper with the same name, Get me off Your F****** Mailing List by Mazières and Kohle (2005), published in a predatory journal. Some people may know it.

I am seriously interested in recreating the same scatter plot to test a new density-based clustering algorithm without the need of creating all the letters from scratch.

Is there any way to make this process easier? (e.g. a dataset, or a package, or a smart way to recreate the plot)


Solution

  • Now that the grid package supports clipping paths, we can do:

    library(grid)
    library(ggplot2)
    
    tg <- textGrob("Get me off\nYour Fuck\ning Mailing\nList", x = 0.2,
                   hjust = 0,
                   gp = gpar(cex = 6, col = "grey", font = 2))
    cg <- pointsGrob(x= runif(15000), y = runif(15000), pch = 3,
                     gp = gpar(cex = 0.5))
    
    rg <- rectGrob(width = unit(0.5, 'npc'), height = unit(0.1, 'npc'),
                   gp = gpar(fill = 'red'))
    
    ggplot(data = NULL, aes(x = 100, y = 100)) +
      geom_point(col = 'white') +
      theme_classic() +
      theme(panel.border = element_rect(fill = 'white', linewidth = 1))
    
    pushViewport(viewport(clip = tg))
    grid.draw(cg)
    

    enter image description here