Create Plot that Shows Only Text in R (Example Code)
This tutorial explains how to create a graphic that contains only text in the R programming language.
Example: Draw ggplot2 Plot that Contains Only Text
install.packages("ggplot2") # Install & load ggplot2 package library("ggplot2") |
install.packages("ggplot2") # Install & load ggplot2 package library("ggplot2")
my_text <- "Some random textnin a ggplot2 Graphic!" # Create text object |
my_text <- "Some random textnin a ggplot2 Graphic!" # Create text object
ggplot() + # Draw text in ggplot2 plot annotate("text", x = 5, y = 5, size = 7, label = my_text) + theme_void() |
ggplot() + # Draw text in ggplot2 plot annotate("text", x = 5, y = 5, size = 7, label = my_text) + theme_void()