How to use log argument in base R In R Language
In this method to change the axis intervals of the given plot, the user needs to use the log arguments with the plot function to transform one of the axes into a log scale, this will be changing the axis defined by the user to the logarithm axis in the R programming language.
Syntax:
barplot(data,log='x/y')
Example: Initial plot
R
gfg<- c (8,9,6,5,8,5,1,7,3,5) barplot (gfg) |
Output:
Example: Change axis intervals
R
gfg<- c (8,9,6,5,8,5,1,7,3,5) barplot (gfg,log= 'y' ) |
Output:
How to Change Axis Intervals in R Plots?
In this article, we will be looking at the different approaches to change axis intervals in the R programming language.