I've created a graph presenting data in linear units but in logarithmic y-scale (code below).
ggplot() + geom_point(data=VH_lin, aes(x=VH_lin[,1], y=VH_lin[,2], colour = "green"), size=0.6) + scale_y_log10(breaks = c(0,0.01, 0.10, 1.00, 10), limit=c(-0.01,10)) + scale_x_continuous(breaks=c(0, 2000, 4000, 6000, 8000, 10000, 12000)) + xlab("x") + ylab("y") + theme(panel.background = element_rect(fill = "white", colour = "grey50")) I would like to add second y scale in decibels - which are logarithmic units. To transform data I have to calculate 10*log10(x) so the distribution of data on the plot should be the same - as dB are logarithmic. Basically, I would like to present the dame data on the same plot using two units: linear (but presented in logarithmic scale - already in the code) and dB. Is it possible? The pic below (poorly) presents my idea.
Example of VH_lin data:
1 0 0.012729834 2 3.133577295 0.012729834 10 14.75257582 0.013739633 36 59.10725461 0.014644137 41 69.42152155 0.0103109 466 1180.242805 0.011991354 486 1204.63381 0.008985861 520 1256.814223 0.008706877 