Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Use scale_x_log10() and/or
scale_y_log10() (Figure 8-26):
library(MASS)# For the data set# The base plotp<-ggplot(Animals,aes(x=body,y=brain,label=rownames(Animals)))+geom_text(size=3)p# With logarithmic x and y scalesp+scale_x_log10()+scale_y_log10()
With a log axis, a given visual distance represents a constant proportional change; for example, each centimeter on the y-axis might represent a multiplication of the quantity by 10. In contrast, with a linear axis, a given visual distance represents a constant quantity change; each centimeter might represent adding 10 to the quantity.