A would like to plot geom_tile() without displaying the surrounding grey frame. 开发者_如何学JAVAExample:
library(ggplot2)
p <- ggplot(melt(volcano), aes(x = X1, y = X2, z = value,fill = value)) + geom_tile()
print(p)
Produces the figure below, which would look better had not the theme background framed the heatmap proper. I imaging the padding is the same 4% as in base graphics. It's good to have it most of the time, but not always.
I assume the same solution to this problem could be applied to other geoms as well.
just do print(p1 + scale_x_continuous(expand = c(0, 0)) + scale_y_continuous(expand = c(0, 0)))
and that will get rid of the gray space around
精彩评论