# How to create a scatterplot using five vectors in a single plot window without separating the plots in R?

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 more than one scatterplot in a single plot window we should create the scatterplot for first vector and then add the point of the remaining vectors by using points function and they can be displayed with different colors so that it becomes easy to differentiate among the points of the vectors.

## Example

Consider the below vectors −

Live Demo

x1<-rnorm(5,1,0.5)
x2<-rnorm(5,1,0.4)
x3<-rnorm(5,1,0.3)
x4<-rnorm(5,1,0.2)
x5<-rnorm(5,1,0.1)
plot(x1)

## Example

points(x2,col=2)

## Example

points(x3,col=3)

## Example

points(x4,col=4)


## Example

points(x5,col=5)

## Output

Updated on 17-Oct-2020 08:10:28