I have a problem with reversing a log x-axis in ggplot. Here is my code:
0.0869576738, 0.0666142143, 0.0529221747, 0.0459094227, 0.0435728234 0.0421749374, 0.0386231044,
0.0270527626, 0.0154564383, 0.0020047625, -0.0003503735, -0.0107725653 -0.0097896394, -0.0142337166,
-0.0055407872, -0.0034185364, -0.0073841739, -0.0028702151, 0.0001600470, -0.0125737857)
xscale_limits <- seq(2.3,9.3,0.21)
xbreaks1 <- c(10,60,120,600,6000)
d<-data.frame(x=scales, y=lambda)
p =ggplot(d, aes(x)) +
geom_line(aes(y=y )) +
scale_x_log10(breaks=xbreaks1)
#So far, everything looks just fine. Next, I transform the values on the x-axis according to:
trans_scales <- 1/scales *1000
#and my new breaks should be:
xbreaks2 <- c(100,10,2,1,0.17) #(according to xbreaks1)
Now, I want the values on the x-axis to start at 100 and become smaller towards the right. The shape of the graph should not change. Unfortunately scale_x_reverse() changes only the values but not the log-scale itself. I will add a photoshoped picture to make clear how the graph should look like.
Thank for any help.