Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Load required packages
- library(ggplot2)
- library(data.table)
- library(colorRamps)
- library(scales)
- # Import spatial timeseries data
- df <- data.table(read.csv("timeseries_example.csv"))
- df$date <- as.POSIXct(strptime(df$date, format="%m/%d/%Y", tz="GMT"))
- # Scatterplot with color representing the z parameter
- Fig <-
- ggplot(data=df, aes(date, dep, col=Sal))+
- geom_point()+
- scale_y_reverse()+
- scale_colour_gradientn(colours = matlab.like2(7), oob=squish)
- tiff("./example_timeseries_R_ggplot.tiff", width = 200, height = 100,
- units = 'mm', res = 300, compression = 'lzw')
- Fig
- dev.off()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement