Commit 598537f5 authored by nperez's avatar nperez
Browse files

degree_sym added to PlotEquiMap

parent 36b9fcd5
......@@ -125,6 +125,7 @@
#'@param lab_dist_y A numeric of the distance of the latitude labels to the
#' box borders. The default value is NULL and is automatically adjusted by
#' the function.
#'@param degree_sym A logical indicating whether to include degree symbol (30° N) or not (30N; default).
#'@param intylat Interval between latitude ticks on y-axis, in degrees.
#' Defaults to 20.
#'@param intxlon Interval between latitude ticks on x-axis, in degrees.
......@@ -237,7 +238,7 @@ PlotEquiMap <- function(var, lon, lat, varu = NULL, varv = NULL,
arr_ref_len = 15, arr_units = "m/s",
arr_scale_shaft = 1, arr_scale_shaft_angle = 1,
axelab = TRUE, labW = FALSE,
lab_dist_x = NULL, lab_dist_y = NULL,
lab_dist_x = NULL, lab_dist_y = NULL, degree_sym = FALSE,
intylat = 20, intxlon = 20,
axes_tick_scale = 1, axes_label_scale = 1,
drawleg = TRUE, subsampleg = NULL,
......@@ -708,20 +709,34 @@ PlotEquiMap <- function(var, lon, lat, varu = NULL, varv = NULL,
ypos <- seq(latmin, latmax, intylat)
xpos <- seq(lonmin, lonmax, intxlon)
letters <- array('', length(ypos))
letters[ypos < 0] <- 'S'
letters[ypos > 0] <- 'N'
if (degree_sym == FALSE) {
letters[ypos < 0] <- 'S'
letters[ypos > 0] <- 'N'
} else {
letters[ypos < 0] <- '° S'
letters[ypos > 0] <- '° N'
}
ylabs <- paste(as.character(abs(ypos)), letters, sep = '')
letters <- array('', length(xpos))
if (labW) {
xpos2 <- xpos
xpos2[xpos2 > 180] <- 360 - xpos2[xpos2 > 180]
}
letters[xpos < 0] <- 'W'
letters[xpos > 0] <- 'E'
if (degree_sym == FALSE) {
letters[xpos < 0] <- 'W'
letters[xpos > 0] <- 'E'
} else {
letters[xpos < 0] <- '° W'
letters[xpos > 0] <- '° E'
}
if (labW) {
letters[xpos == 0] <- ' '
letters[xpos == 180] <- ' '
letters[xpos > 180] <- 'W'
if (degree_sum == FALSE) {
letters[xpos > 180] <- 'W'
} else {
letters[xpos > 180] <- '° W'
}
xlabs <- paste(as.character(abs(xpos2)), letters, sep = '')
} else {
xlabs <- paste(as.character(abs(xpos)), letters, sep = '')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment