Modifying Plots in R: (R Tutorial 2.8)
In this video you will learn how to modify plots produced in R to change from the default values in great detail.
First we will show you how to access help menu in R for different plotting parameters using "par" command. Next you will learn to modify plots by changing the sizes of: plotting characters using "cex" argument, the title of a plot using "cex.main" argument, the x and y labels of a plot in R using "cex.lab" argument, and the x and y axes values using "cex.axis" argument. This tutorial will also show you how to change the fonts for: plot’s title using "font.main" argument, the x or y labels using "font.lab" argument, and the x and y axis using the "font.axis" argument.
You will also see how you can change the colour of: plotting characters in R using the "col" argument, the title of a plot in R using the "col.main" argument, the x and y labels using the "col.lab" argument, and the x and y axis using the "col.axis" argument. Later in the video we will show you to change the plotting character in R using the "pch" argument, and to add a regression line to a plot in R using the "abline" command and change the line colour using "col" argument, the line type using "lty" argument and the width of the line using "lwd" argument.
You will also learn how to identify different groups on the same plot (eg. male or female) using different plotting characters and colours, re-label x-axis and y-axis using the "xlab" and "ylab" arguments, add more points or observations to an existing plot using the "points" command, produce multiple plots on one screen using "mfrow" or "mfcol" arguments, remove labels from x or the y-axis using the "axes" argument, re-label the x or y axis using "side" argument and "axis" command, add a box around the plot in R using the "box" command and finally add values on top of the plot or on the right side of the plot using the "axis" command and "side" argument.
We recommend using the link below to download the dataset and practice on your own while watching this tutorial.
You can access and download the dataset that was used in this tutorial here: