How to Apply the text() Function in R (Example Code)

In this R programming tutorial you’ll learn how to add text to graphics using the text() function.

Example: Drawing Text to Graphic in R

set.seed(839754)        # Create plot
plot(rnorm(1000),
     rnorm(1000))
text(x = - 0.35,        # Add text to plot
     y = 0.5,
     "WHAT A NICE TEXT",
     col = "red",
     cex = 1.7)

r graph figure 1 apply text function

Leave a Reply

Your email address will not be published.

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

Menu
Top