Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. # Load required packages
  2. library(ggplot2)
  3. library(data.table)
  4. library(colorRamps)
  5. library(scales)
  6.  
  7. # Import spatial timeseries data
  8. df <- data.table(read.csv("timeseries_example.csv"))
  9. df$date <- as.POSIXct(strptime(df$date, format="%m/%d/%Y", tz="GMT"))
  10.  
  11. # Scatterplot with color representing the z parameter
  12.  
  13. Fig <-
  14. ggplot(data=df, aes(date, dep, col=Sal))+
  15. geom_point()+
  16. scale_y_reverse()+
  17. scale_colour_gradientn(colours = matlab.like2(7), oob=squish)
  18.  
  19. tiff("./example_timeseries_R_ggplot.tiff", width = 200, height = 100,
  20. units = 'mm', res = 300, compression = 'lzw')
  21. Fig
  22. dev.off()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement