points_color: Plot points with color

View source: R/points_color.R

points_colorR Documentation

Plot points with color

Description

Plot points with color

Usage

points_color(
  x,
  y,
  z,
  col = hcl.colors(41, "Blue-Red"),
  zlim = range(z),
  pch = 19,
  cex = 1,
  outside = TRUE,
  verbose = F,
  ...
)

Arguments

x

x-axis coordinate

y

y-axis coordinate

z

values

col

color

zlim

custom zlim

pch

passed to points

cex

passed to points

outside

to include values outside zlim

verbose

to display additional information

...

other arguments passed to points and value2color

Examples

library(raster)
## some maps to include
masp   <- raster::shapefile(paste0(system.file("extdata",package="hackWRF"),
                            "/RMSP.shp"))
br     <- raster::shapefile(paste0(system.file("extdata",package="hackWRF"),
                            "/BR_states.shp"))

## site-list w/ lat-lon
stations <- readRDS(paste0(system.file("extdata",package="hackWRF"),
                    "/stations.Rds"))

## open a evaluation table
sample <- read.stat(paste0(system.file("extdata", package = "hackWRF"),
                           "/sample.csv"),verbose=TRUE)
row.names(sample) <- c("Americana","Campinas","Congonhas")

## combination of lat-lon and evaluation table
coord  <- latlon(sample, coord = stations)

## plot
plot(NA, xlim = c(-47.75,-45.5), ylim = c(-24.7,-22.2),
     xlab = 'lon',ylab = 'lat')
points_color(x = coord$lon, y = coord$lat,z = coord$MB)
lines(masp, col = 'gray');lines(br)


Schuch666/hackWRF documentation built on June 9, 2025, 1:46 p.m.