Commit f8b987fb authored by aho's avatar aho
Browse files

Add parameter 'contour_draw_label' to decide whether to draw the contour labels or not.

parent b7b08d68
......@@ -75,6 +75,8 @@
#' and 'brks2', or if 'square = FALSE'.
#'@param contour_lty Line type of the contour curves. Takes 1 (solid) by
#' default. See help on 'lty' in par() for other accepted values.
#'@param contour_draw_label A logical value indicating whether to draw the
#' contour labels or not. The default value is TRUE.
#'@param contour_label_scale Scale factor for the superimposed labels when
#' drawing contour levels.
#'@param dots Array of same dimensions as 'var' or with dimensions
......@@ -216,7 +218,7 @@ PlotEquiMap <- function(var, lon, lat, varu = NULL, varv = NULL,
coast_color = NULL, coast_width = 1,
contours = NULL, brks2 = NULL, contour_lwd = 0.5,
contour_color = 'black', contour_lty = 1,
contour_label_scale = 1,
contour_draw_label = TRUE, contour_label_scale = 1,
dots = NULL, dot_symbol = 4, dot_size = 1,
arr_subsamp = floor(length(lon) / 30), arr_scale = 1,
arr_ref_len = 15, arr_units = "m/s",
......@@ -460,6 +462,11 @@ PlotEquiMap <- function(var, lon, lat, varu = NULL, varv = NULL,
stop("Parameter 'contour_lty' must be either a number or a character string.")
}
# Check contour_draw_label
if (!is.logical(contour_draw_label)) {
stop("Parameter 'contour_draw_label' must be logical.")
}
# Check contour_label_scale
if (!is.numeric(contour_label_scale)) {
stop("Parameter 'contour_label_scale' must be numeric.")
......@@ -741,7 +748,7 @@ PlotEquiMap <- function(var, lon, lat, varu = NULL, varv = NULL,
# labcex = cex_axes_labels,
labcex = contour_label_scale * par("cex"),
lwd = contour_lwd, lty = contour_lty,
col = contour_color)
col = contour_color, drawlabels = contour_draw_label)
}
#
......
......@@ -30,6 +30,7 @@ PlotEquiMap(
contour_lwd = 0.5,
contour_color = "black",
contour_lty = 1,
contour_draw_label = TRUE,
contour_label_scale = 1,
dots = NULL,
dot_symbol = 4,
......@@ -158,6 +159,9 @@ and 'brks2', or if 'square = FALSE'.}
\item{contour_lty}{Line type of the contour curves. Takes 1 (solid) by
default. See help on 'lty' in par() for other accepted values.}
\item{contour_draw_label}{A logical value indicating whether to draw the
contour labels or not. The default value is TRUE.}
\item{contour_label_scale}{Scale factor for the superimposed labels when
drawing contour levels.}
......
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