r stat_contour incorrect fill with polygon
问题 When I use stat_contour with polygon, some regions should not be filled because there is no data there, i marked them in the figure. Does anyone know how to avoid that? In addition, there is space between axis and plot region, how to remove it?! Here is the plotting code: plot_contour <- function (da, native ) { h2d<-hist2d(da$germ_div,da[[native]],nbins=40,show=F) h2d$counts<-h2d$counts+1 counts<-log(h2d$counts, base=10) rownames(counts)<-h2d$x colnames(counts)<-h2d$y counts<-melt(counts)