Part A: Scatterplot
data(mtcars) #loading in the dataset
plot(mtcars$cyl, mtcars$mpg, #plot by (x,y)
xlab = "Cylinders",#name x axis
ylab = "Miles per Gallon", #name y axis
main = "Car Cylinder vs Miles per Gallon", #main title
pch = 19, #change data point shapes
col = "hotpink", #change data point colors
cex = 1.5) #change data point size
grid(nx = NULL, ny = NULL, #making grid appear on x and y axis
lty = 1, #set grid line type
col = "pink", #set grid color
lwd = 1) #set grid line width

Part B: Line Plot
year <- c(2000, 2005, 2010, 2015, 2020, 2025) #creating my own small dataset
population <- c(527, 541, 584, 612, 652, 698) #creating my own small dataset
plot( #plotting my dara
year, #x axis
population, #y axis
type= "b", #type of line graph, includes points and lines
lwd = 5, #line type/width
col = "turquoise", #select color
xlab = "Year", #name x axis
ylab = "Population", #name y axis
main = "Population Over Time") #title graph
legend("topleft", #create legend and specify location on graph
legend = c("American Population"), #what is on the legend
col = "turquoise", #point color
text.col = "darkturquoise", #text color
bty = "n", #remove box around legend
pch = 19) #point shape & size
