-1

I was wondering how I would add more space above and below the y min and y max using ggplot in r. A picture below shows what the current situation is, but I want more space above the top number and below the bottom one.

enter image description here

alistaire
  • 42,459
  • 4
  • 77
  • 117
  • I have updated the question with a new one please take a look @Winter – WizardCovfefe Jul 16 '18 at 01:04
  • [avoiding axis tick label collision in faceted ggplots](https://stackoverflow.com/questions/41575045/avoiding-axis-tick-label-collision-in-faceted-ggplots) – Sandy Muspratt Jul 16 '18 at 06:15
  • that helps but is insanely complicated to fix something so simple – WizardCovfefe Jul 16 '18 at 12:36
  • If you want simplicity, you could use `theme(panel.spacing.y = unit(2, "lines"))` or something similar. But I thought that increasing the panel spacing was not an option (though that message seems to have disappeared). – Sandy Muspratt Jul 16 '18 at 22:24

1 Answers1

0

I got this directly from this post: I think this will answer your question.

library(ggplot2)
x <- 1:4
y <- c(0, 0.0001, 0.0002, 0.0003)

dd <- data.frame(x, y)

scientific_10 <- function(x) {
  parse(text=gsub("e", " %*% 10^", scales::scientific_format()(x)))
}

ggplot(dd, aes(x, y)) + geom_point()+scale_y_continuous(label=scientific_10)
DevGin
  • 443
  • 3
  • 12