How to draw x and y axis in ggplot2 r? ( R, Ggplot2 )

Problem :
( Scroll to solution )

So, I’d like to draw x and y axis using ggplot2. I managed to draw x axis with a function: fun = function{x} {x* 0 }, but I don’t know how to do the same with y axis. If I use built in functions that draw x and y axis, like for example: theme(axis.line.x = element_line(…)), then I get the lines to be outside the plot itself, but I need the axis to see where they intersect with other functions.
Can anyone assist?

Try:

+ geom_hline(yintercept = 0) + geom_vline(xintercept = 0)

Read more here: Source link