0
votes

First of all let me show you a picture of what I have so far:

enter image description here

Here is the code for the picture:

 ggplot(ini_for_ann_def,aes(x=ini_for,y=ann_def)) + 
  geom_point(alpha = 0.05) +
  scale_x_continuous("Cover") +
  scale_y_continuous("Percentage Change") +
  theme(panel.background = element_blank())

For my data the values (named in the cover in the picture) on the x-axis range from 0.00 to 1.00 (the data are continuous). Ggplot automatically decides to start to order/arrange the values on the x-axis in an ascending order, going from 0.00 to 1.00. However, I would like ggplot2 to reverse that order, plotting from 1.00 to 0.00 (descending order). Is that possible in ggplot2?

1

1 Answers

3
votes

You can use scale_x_reverse() to plot data on x in descending order.

ggplot(mtcars,aes(mpg,disp))+geom_point()+
  scale_x_reverse()