Change axis and tick label size using par() function
In this approach to change the axis and trick label size, the user needs to use the cex.lab() and cex.axis() arguments of the par() function to specify the size of the axis labels and the tick labels respectively in the R Language. The default value of both the cex.lab and cex.axis is 1.
Syntax:
par( cex.lab, cex.axis )
where,
- cex.lab: determines the size of the axis label.
- cex.axis: determines the size of the tick labels.
Example:
In this example, a plot with a large-sized axis and tick labels is made using the par() function with cex.axis and cex.lab parameter.
R
# set axis and tick label size with # par() function par ( cex.axis= 3, cex.lab= 2) # draw plot plot (1:20) |
Output:
How to Use Par Function in R?
In this article, we will discuss how to use the par() function in the R Programming Language.
The par() function is used to set or query graphical parameters. We can divide the frame into the desired grid, add a margin to the plot or change the background color of the frame by using the par() function. We can use the par() function in R to create multiple plots at once. This helps us to create a figure arrangement with fine control.
Contact Us