0

I've been trying to plot contour plots using ggplot2 and csv file. I can't figure out why there are horizontal gaps showing up across the image.

Here is the code:

library(ggplot2)

plot2 <- ggplot(data=thirtyfour,aes( x = X.m., y = Z.m., z = t_ca.2))
plot2
plot2 + geom_tile(aes(fill = t_ca.2) )+
  scale_fill_continuous(limits=c(0,0.0219),
                        breaks=seq(0,0.0219, by=0.01),
                        low="blue",
                        high="yellow")

enter image description here

MrFlick
  • 195,160
  • 17
  • 277
  • 295
  • We need to know more about your data to understand what's going on. Are your x and y values discrete? Evenly spaced? It's easier to help you if you provide a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input data that we can run and test with. – MrFlick Jul 19 '17 at 19:55
  • Thank you for the tip1 the ",height=1" parameter worked perfectly – Anna Ortiz Jul 20 '17 at 21:40

1 Answers1

1

In the geom_tile aesthetic try adjusting the height parameter.

+geom_tile(aes(fill=t_ca.2, height=1)) +...

Otherwise, please provide reproducible example code.

Tiffany
  • 561
  • 4
  • 11