I\'m trying to generate some fractals and have a question regarding the margins with ggplot in R. I\'m using the following code to generate the fractals.
lib
You can also use theme_nothing()
from the cowplot package:
require(cowplot)
qplot(1:10, (1:10)^2, geom='line') + theme_nothing() +
scale_x_continuous(expand=c(0,0)) +
scale_y_continuous(expand=c(0,0)) +
labs(x = NULL, y = NULL)
Unfortunately, you still need to add labs(x = NULL, y = NULL)
, because there is no way in ggplot2's theme machinery to remove the axes completely. And you need to set expand=c(0,0)
in the scale parameters to make sure the scale doesn't extend beyond your data range.
Result: