![]() You'll have to do a little data transformation though. The final result was pretty good, and I think you should give it a try. However, I never managed to get a satisfactory result, and ended up using "ntour". My initial attempt also was to use ggplot, since I try to keep it as my essential plotting tool. I tried to create a similar plot a couple years ago, but for a time series of soil moisture in eleven soil depths. You have a lot of data points, so a small subset of time maybe. A reproducible example of where you areįeaturing some data from dput would make it easier to help you. > and date-time - that is the only reason that both are in the dataframe. > I have tried using just the date for the x value I figured this group would have a solution. I enjoy using ggplot and would like to continue to do so. Maybe I'm using the wrong tool within R to produce this type of plot. Not to mention, it takes minutes to render millions of values. I tried modeling the data using the loess function which helps smooth the data, unfortunately it creates an incredibly large dataset, bumping into memory limits on my machine. I believe it also models more time steps, to make a smoother graph. Of course, part of the difference between the two is that the first graph uses modeled data to fill in the gaps between depths. This produces a very choppy graph with no data between the depths. V <- v + geom_tile(aes(fill=temperature)) V <- v + scale_fill_gradientn(colours=rev(rainbow(10))) ![]() V <- ggplot(data,aes(date_time,depth,z=temperature)) ![]() When I use ggplot2 and the stat_contour function, I produce the following graph: You just have to imagine another 100k records! Unfortunately, due the large size of the dataset (100k observations for a year), I cannot attach the dataset, or replicate it. I would like to create a graph like this.ĭepth on y axis, time on x axis and the water temperature used for z axis. I have hourly readings of temperature at 0, 1.5, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 meters beneath the surface of the water for an entire year. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |