# How to create a perpendicular arrow in base R plot?

R ProgrammingServer Side ProgrammingProgramming

#### Artificial Intelligence : The Future Of Programming

15 Lectures 54 mins

#### Beyond Basic Programming - Intermediate Python

Most Popular

36 Lectures 3 hours

#### C Programming from scratch- Master C Programming

Best Seller

60 Lectures 8 hours

To create a perpendicular arrow in base R plot, we can use arrows function. There are five arguments of arrows function that will be used to create the perpendicular arrow. The first four values define the position of the arrow and the last argument xpd allows R to create the arrow. Check out the below examples to understand how it works.

## Example

plot(1:10)
arrows(1,-1,1,0,xpd=TRUE)

## Example

plot(1:10)
arrows(1,-1,1,2,xpd=TRUE)

## Example

plot(1:10)
arrows(2,-1,2,2,xpd=TRUE)

## Output

Updated on 06-Feb-2021 11:29:48