Trusted answers to developer questions

Onyejiaku Theophilus Chidalu

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The ** plot() function** in R is used to draw or create graphs and charts for visualizations. In simple terms, the

`plot()`

function is used to return a plot of a number(s) against another number(s).```
plot(x, y)
```

The `plot()`

function takes two parameter values:

: Represents points on the x-axis of the plot.`x`

: Represents points on the y-axis of the plot.`y`

Let’s create a plot of the number `2`

against `6`

using the `plot()`

function.

plot(2, 6)

Implementing the plot() function

The `plot()`

function can also be used to draw two points in a diagram, where one point represents a position at (x, y) and another represents another position at (x, y).

plot(c(2, 6), c(4, 12))

Implementing the plot() function for two points

For a number of points, one needs to provide the same number of points for both axes.

# creating equal axisx <- c(1, 2, 3, 4, 5)y <- c(3, 6, 9, 12, 15)# implementing the plot() functionplot(x, y)

Implementing the plot() function for multiple points

**Lines 2 and 3**: We create the values of the points in the`x`

and`y`

axis, respectively. We use their corresponding names (`x`

and`y`

) as their variable names.**Line 6**: We plot the various points in the`x`

and`y`

axis using the`plot()`

function.

RELATED TAGS

function

r

plot

communitycreator

CONTRIBUTOR

Onyejiaku Theophilus Chidalu

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring

Related Courses