# How to create a line chart in R using plot function with larger width?

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 line chart in base R using plot function, we need to use type = "l" so that R understand the plot needs to have a line instead of points. If we want to increase the width of the line then lwd argument can be used. The value lwd = 0 is the default value for the width.

Consider the below vector and create the line chart −

## Example

x<-1:10
plot(x,type="l")

## Output

Create the line chart with larger width of the line −

## Example

plot(x,type="l",lwd=5)

## Output

Create the line chart with very wide line −

## Example

plot(x,type="l",lwd=10)

## Output

Updated on 14-Oct-2020 15:06:04