diff --git a/R/PlotEquiMap.R b/R/PlotEquiMap.R index b8b7bd60fc89d6bd8d341f2162f35f280c6729f1..5ab051726c4dcf032be19ac8135b4bb0e31aa7fb 100644 --- a/R/PlotEquiMap.R +++ b/R/PlotEquiMap.R @@ -12,7 +12,8 @@ PlotEquiMap <- function(var, lon, lat, varu = NULL, varv = NULL, arr_subsamp = floor(length(lon) / 30), arr_scale = 1, arr_ref_len = 15, arr_units = "m/s", arr_scale_shaft = 1, arr_scale_shaft_angle = 1, - axelab = TRUE, labW = FALSE, + axelab = TRUE, labW = FALSE, + lab_dist_x = NULL, lab_dist_y= NULL, intylat = 20, intxlon = 20, axes_tick_scale = 1, axes_label_scale = 1, drawleg = TRUE, subsampleg = NULL, @@ -476,11 +477,14 @@ PlotEquiMap <- function(var, lon, lat, varu = NULL, varv = NULL, mgp = c(0, spaceticklab, 0), las = 0) plot.window(xlim = range(lonb$x, finite = TRUE), ylim = range(latb$x, finite = TRUE), xaxs = 'i', yaxs = 'i') - if (axelab) { + if (axelab) { + lab_distance_y <- ifelse(is.null(lab_dist_y), spaceticklab + 0.2, lab_dist_y) + lab_distance_x <- ifelse(is.null(lab_dist_x), spaceticklab + cex_axes_labels / 2 - 0.3, lab_dist_x) axis(2, at = ypos, labels = ylabs, cex.axis = cex_axes_labels, tcl = cex_axes_ticks, - mgp = c(0, spaceticklab + 0.2, 0)) + mgp = c(0, lab_distance_y, 0)) axis(1, at = xpos, labels = xlabs, cex.axis = cex_axes_labels, tcl = cex_axes_ticks, - mgp = c(0, spaceticklab + cex_axes_labels / 2 - 0.3, 0)) + mgp = c(0, lab_distance_x, 0)) + } title(toptitle, cex.main = cex_title) rect(par("usr")[1], par("usr")[3], par("usr")[2], par("usr")[4], col = colNA) diff --git a/man/PlotEquiMap.Rd b/man/PlotEquiMap.Rd index 85d92746fc1a62920c6245d6e956146eb55206a4..b7d9596108f177fc41670b25e5fd7f132b063e62 100644 --- a/man/PlotEquiMap.Rd +++ b/man/PlotEquiMap.Rd @@ -22,6 +22,7 @@ PlotEquiMap(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, intylat = 20, intxlon = 20, axes_tick_scale = 1, axes_label_scale = 1, drawleg = TRUE, subsampleg = NULL, @@ -135,6 +136,12 @@ Whether to draw longitude and latitude axes or not. TRUE by default. \item{labW}{ Whether to label the longitude axis with a 'W' instead of minus for negative values. Defaults to FALSE. } + item{lab_dist_x}{ +Increase/decrease the distance between the box and the longitude labels. Defaults to NULL (optimal distance). +} + item{lab_dist_y}{ +Increase/decrease the distance between the box and the latitude labels. Defaults to NULL (optimal distance). +} \item{intylat}{ Interval between latitude ticks on y-axis, in degrees. Defaults to 20. }