Skip to content

Commit

Permalink
oce.plot.ts() obeys 'xlab' (issue 2285)
Browse files Browse the repository at this point in the history
  • Loading branch information
dankelley committed Jan 20, 2025
1 parent 69cfa71 commit b4491fc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* Change `mapPlot()` to handle `las` as a parameter (issue #1707).
* Change `oce.plot.ts()` to handle `grid` better (issue #2267).
* Change `oce.plot.ts()` to handle `simplify` better (issue #2277).
* Change `oce.plot.ts()` to handle `xlab` (issue #2285).
* Change `plot.section()` to handle `eos="gsw"` (issue #2256).
* Change `read.amsr()` to handle realtime data files (issue #2230).
* Change `read.ctd.sbe()` to handle files that lack salinity and conductivity (issues #2279 and #2282).
Expand Down
6 changes: 2 additions & 4 deletions R/oce.R
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@ oce.grid <- function(xat, yat, col = "lightgray", lty = "dotted", lwd = par("lwd
#' # Flip the y axis
#' oce.plot.ts(t, y, flipy = TRUE)
oce.plot.ts <- function(
x, y, type = "l", xlim, ylim, log = "", logStyle = "r", flipy = FALSE, xlab, ylab,
x, y, type = "l", xlim, ylim, log = "", logStyle = "r", flipy = FALSE, xlab = "", ylab,
drawTimeRange, simplify = 2560, fill = FALSE, col = par("col"), pch = par("pch"),
cex = par("cex"), cex.axis = par("cex.axis"), cex.lab = par("cex.lab"), cex.main = par("cex.main"),
xaxs = par("xaxs"), yaxs = par("yaxs"),
Expand All @@ -1163,9 +1163,6 @@ oce.plot.ts <- function(
if (!inherits(x, "POSIXt")) {
x <- as.POSIXct(x)
}
if (missing(xlab)) {
xlab <- ""
}
if (missing(ylab)) {
ylab <- deparse(substitute(expr = y, env = environment()))
}
Expand Down Expand Up @@ -1382,6 +1379,7 @@ oce.plot.ts <- function(
type = type, col = col, cex = cex, cex.axis = cex.axis, cex.lab = cex.lab, pch = pch, log = log, ...
)
# mtext(paste("TEST: xlab at mgp[1]", xlab), side=1, cex=cex.lab*par("cex"), line=mgp[1])
mtext(xlab, side = 1, cex = cex.lab * par("cex"), line = mgp[1])
mtext(ylab, side = 2, cex = cex.lab * par("cex"), line = mgp[1])
}
xat <- NULL
Expand Down
2 changes: 1 addition & 1 deletion man/oce.plot.ts.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b4491fc

Please sign in to comment.