1

Consider the following plot:

ggplot(data.frame(x=c(-3, +3)), aes(x)) + 
  stat_function(fun=function(x) 4*x^(1/2)) + 
  stat_function(fun=function(x) x^2) 

parabola

I would like to add an axis to the current plot. With the standard graphics package, one uses axis()

Is it possible to reproduce axis() in ggplot2?

antonio
  • 10,629
  • 13
  • 68
  • 136
  • 1
    You mean centered as in [this question](https://stackoverflow.com/questions/17753101/center-x-and-y-axis-with-ggplot2) ? – neilfws Oct 18 '17 at 23:17
  • I think you could start a bounty – Marco Oct 19 '17 at 15:42
  • I think the answer https://stackoverflow.com/questions/17753101/center-x-and-y-axis-with-ggplot2 is not satisfacory, it should not be labeled as duplicated – Marco Oct 19 '17 at 15:45
  • @Marco The question is still a dupe, even if the previous one hasn't been answered satisfactorily (yet). – 3lectrologos Oct 19 '17 at 17:27
  • This one: https://stackoverflow.com/questions/17134299/r-how-can-i-plot-such-ggplot2 is closer to what he has in mind, except it is done in base graphics. @Marco: is it critical that it has to be done in ggplot2? if so, you want to suppress the axes and then draw ablines and labeling will be tedious. I would suggest to look at the answer by **jbaums** (in my link) and try it in base graphics. – David Oct 21 '17 at 04:19
  • @3lectrologos: now it is different. So if reopened I can open the bounty. – antonio Oct 30 '17 at 12:55

0 Answers0