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
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) + 

r graph figure 1 create that shows only text

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed