r - cut off density plot in ggplot2 -
i use
frame <- read.table(paste('data', fname, sep="/"), sep=",", header=true) colnames(frame) <- c("pos", "word.length") plot <- ggplot(frame, aes(x=pos, y=word.length)) + xlim(0,20) + ylim(0,20) + geom_density2d() + stat_density2d(aes(color=..level..)) png(paste("graphs/", fname, ".png", sep=""), width=600, height=600) print(plot) dev.off() to create plots, cut off. how fix this?
the data used create plot: http://sprunge.us/gkil
according ggplot2 book, use scale_x_continuous(limits=c(1,20)) instead of xlim(1,20) that.
Comments
Post a Comment