0

I am making a bar plot using ggplot2 and would like the x-axis to intersect the y-axis at -1 rather than 0. I am open to using other methods in R for creating the figure if it is not possible to force the x-axis to shift down in ggplot.

Graphing a new line at -1 (not an axis) or transforming the data, as has been suggested in responses to a similar query, would both not be appropriate for this presentation.

Marie
  • 11
  • 1
  • 2
    Do you also want the bars to dip below 0? What is wrong with drawing a line at -1 that looks like an axis but isn't really an axis? Why won't transforming your data work in your case? You'll get a much warmer response and much faster help if you can address those questions and very importantly [**provide a reproducible example**](http://stackoverflow.com/q/5963269/903061) – Gregor Thomas Oct 31 '16 at 22:47

1 Answers1

1

you can find code to move the intersection of the x-axis in this post: X and Y axis intersect at 0

I adapted it like this to move the y-axis down:

plot(x,y, xlim=c(-1.5, 1.2), axes=FALSE, pch=19, ylim=c(-3,8))
axis(1, pos=-1)
axis(2, pos=0)

enter image description here

Community
  • 1
  • 1
Mario
  • 2,393
  • 2
  • 17
  • 37