axis() function in R Language is to add axis to a plot. It takes side of the plot where axis is to be drawn as argument.
axis(side, at=NULL, labels=TRUE)
side: It defines the side of the plot the axis is to be drawn on possible values such as below, left, above, and right.
at: Point to draw tick marks
labels: Specifies texts for tick-mark labels.
In the above example, the straight dotted line is added to the plot joining numerical and alphabetical values plot axis is drawn at the top and bottom part of the plot.
Example 2: Another example to add axes by drawing box
Here, a box is drawn to drawn using box() function around the axis so that it looks like a usual plot.
Here, the different type of axis are drawn implementing modification in line width(lwd) and line type(lty).