codeGK
Code it ALL
R Scatter Plot - CodeGK
♦ R Scatter Plot

♣ About R Scatter Plot

Scatter Plot points x v/s y graph by plotting points in x-y cartesian plane.
R language uses the function plot() function to create a Scatter Plot.

♣ R Scatter Plot Syntax

Below is the representation of R Scatter Plot Syntax.
Basic Syntax
plot(x, y, main, col, xlab, ylab, xlim, ylim, axes)
Syntax Explanation:
Table Info
ParameterUsage
xvector containing numeric values of x-coordinate to be plotted
yvector containing numeric values of y-coordinate to be plotted
maintitle of the Line Graph
colvector specifying color of each line(optional)
xlablabel for x-axis
ylablabel for y-axis
xlimlimits of the values of x used for plotting
ylimlimits of the values of Y used for plotting
axesindicates whether both axes should be drawn on the plot

♣ Example1: Plotting Data using Scatter Plot in R

In this example: Plotting Mileage vs Cylinder consumption as scatter plot.
Example
Input:
Output:
Prev_LessonNext_Lesson
R Scatter Plot