- Related Questions & Answers
- How to represent all values of X-axis or Y-axis on the graph in R using ggplot2 package?
- How to create a plot in base R with dates sequence on X-axis?
- How to create a bar plot using ggplot2 with percentage on Y-axis in R?
- How to specify values on Y-axis in Python Matplotlib?
- Transform the element along with x-axis and y-axis with CSS
- Transform the element by using x-axis, y-axis, and z-axis with CSS3
- How to create a barplot with gaps on Y-axis scale in R?
- How to display raise to the power on X-axis in base R plot?
- Show the origin axis (x,y) in Matplotlib plot
- How to plot the X-axis labels on the upper-side of the plot in R?
- How to create a plot with reversed Y-axis labels in base R?
- Overlapping Y-axis tick label and X-axis tick label in Matplotlib
- How to change the Y-axis values in a bar plot using ggplot2 in R?
- C Program to check if the points are parallel to X axis or Y axis
- How to turn on minor ticks only on the y-axis Matplotlib?

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

We can plot numerical values in R with many scales and that includes log scale as well. Also, it is possible to plot the values with log scales on both the axes. In base R, the best way to do this is defining the axes values with decimal representation as shown in the below examples with well-defined log.

Consider the below vector −

set.seed(555) x<-sample(1:9,10,replace=TRUE) x

[1] 4 8 7 5 6 1 9 2 1 8

Creating plot of x with log scale on both, x and y axis −

plot(x,xlim=c(0.000001,10),ylim=c(0.000001,10),log="xy")

Creating plot of x with log scale on y axis only −

plot(x,xlim=c(0.000001,10),ylim=c(0.000001,10),log="y")

Creating plot of x with log scale on x axis only −

plot(x,xlim=c(0.000001,10),ylim=c(0.000001,10),log="x")

Advertisements