session_grid(NULL)
n <- 15
lon <- rev(sort(runif(n,min=40,max=60)))
lat <- sort(runif(n,min=30,max=50))
pt <- data.frame(lon=lon,lat=lat,value=seq(n))
if (requireNamespace("sp")) {
sp::coordinates(pt) <- c("lon","lat")
sp::proj4string(pt) <- "EPSG:4326"
} else {
pt <- sf::st_as_sf(pt,coords=c("lon","lat"),crs="WGS84")
}
ct <- ursa_colortable(colorize(pt$value))
tr <- trackline(pt,connect="consequent")
#opW <- options(warn=0)
session_grid(pt,expand=1.1)
compose_open(2)
panel_new()
panel_plot(pt,col=ct)
panel_decor()
panel_new()
panel_plot(tr,col=ct,lwd=3)
panel_decor()
compose_legend(ct,unit="step number")
compose_close()
Run the code above in your browser using DataLab