Skip to content

Commit

Permalink
changed colors in plots
Browse files Browse the repository at this point in the history
  • Loading branch information
cneyens committed Jul 5, 2024
1 parent fa1b3aa commit 140f7be
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 42 deletions.
16 changes: 8 additions & 8 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ image_to_matrix <- function(m) {
#' xg <- seq(-350, 200, length = 100)
#' yg <- seq(-125, 125, length = 100)
#'
#' contours(ml, xg, yg, nlevels = 20, col = 'dodgerblue3', labcex = 1)
#' contours(ml, xg, yg, 'streamfunction', nlevels = 20, col = 'orange3',
#' contours(ml, xg, yg, nlevels = 20, col = 'dodgerblue', labcex = 1)
#' contours(ml, xg, yg, 'streamfunction', nlevels = 20, col = 'orange',
#' drawlabels = FALSE, add = TRUE)
#'
#' # Not to be confused by contour()
#' try(
#' contour(ml, xg, yg, nlevels = 20, col = 'dodgerblue3', labcex = 1)
#' contour(ml, xg, yg, nlevels = 20, col = 'dodgerblue', labcex = 1)
#' )
#'
#' # For image() or filled.contour()
Expand Down Expand Up @@ -220,7 +220,7 @@ plot.element <- function(x, y = NULL, add = FALSE, pch = 16, cex = 0.75, use.wid
#' xg <- seq(-500, 500, length = 200)
#' yg <- seq(-250, 250, length = 100)
#'
#' contours(m, x = xg, y = yg, col = 'dodgerblue3', nlevels = 20)
#' contours(m, x = xg, y = yg, col = 'dodgerblue', nlevels = 20)
#' plot(m, add = TRUE)
#'
plot.aem <- function(x, y = NULL, add = FALSE, xlim, ylim, frame.plot = TRUE, ...) {
Expand Down Expand Up @@ -263,12 +263,12 @@ plot.aem <- function(x, y = NULL, add = FALSE, xlim, ylim, frame.plot = TRUE, ..
#' @examples
#'
#' # plot arrows
#' contours(m, xg, yg, col = 'dodgerblue3', nlevels = 20)
#' plot(paths, add = TRUE, col = 'orange3', arrows = TRUE, length = 0.05)
#' contours(m, xg, yg, col = 'dodgerblue', nlevels = 20)
#' plot(paths, add = TRUE, col = 'orange', arrows = TRUE, length = 0.05)
#'
#' # plot point markers every 2.5 years
#' contours(m, xg, yg, col = 'dodgerblue3', nlevels = 20)
#' plot(paths, add = TRUE, col = 'orange3', marker = 2.5 * 365, pch = 20)
#' contours(m, xg, yg, col = 'dodgerblue', nlevels = 20)
#' plot(paths, add = TRUE, col = 'orange', marker = 2.5 * 365, pch = 20)
#'
#' # plot point markers every 600 days
#' plot(paths, add = TRUE, col = 'forestgreen', marker = 600, pch = 1)
Expand Down
22 changes: 11 additions & 11 deletions R/tracelines.R
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ outside_vertical <- function(aem, x, y, z, ...) {
#' xg <- seq(-500, 500, length = 100)
#' yg <- seq(-300, 300, length = 100)
#'
#' contours(m, xg, yg, col = 'dodgerblue3', nlevels = 20)
#' plot(paths, add = TRUE, col = 'orange3')
#' contours(m, xg, yg, col = 'dodgerblue', nlevels = 20)
#' plot(paths, add = TRUE, col = 'orange')
#' points(endp[, c('x', 'y')])
#'
#' # Backward tracking with retardation; plot point marker every 5 years
Expand All @@ -215,13 +215,13 @@ outside_vertical <- function(aem, x, y, z, ...) {
#' ls <- headlinesink(x0 = -100, y0 = 100, x1 = 400, y1 = -300, hc = 7)
#'
#' m <- aem(k, top, base, n = n, uf, rf, w1, w2, ls)
#' contours(m, xg, yg, col = 'dodgerblue3', nlevels = 20)
#' contours(m, xg, yg, col = 'dodgerblue', nlevels = 20)
#' plot(m, add = TRUE)
#'
#' x0 <- seq(-400, 400, 50); y0 <- 200
#' times <- seq(0, 5 * 365, 365 / 20)
#' paths <- tracelines(m, x0 = x0, y0 = y0, z0 = top, times = times)
#' plot(paths, add = TRUE, col = 'orange3')
#' plot(paths, add = TRUE, col = 'orange')
#'
#' # User-defined termination in rectangular zone
#' tzone <- cbind(x = c(-300, -200, -200, -300), y = c(150, 150, 100, 100))
Expand All @@ -233,10 +233,10 @@ outside_vertical <- function(aem, x, y, z, ...) {
#' return(in_poly)
#' }
#' paths <- tracelines(m, x0 = x0, y0 = y0, z0 = top, times = times, tfunc = termf)
#' contours(m, xg, yg, col = 'dodgerblue3', nlevels = 20)
#' contours(m, xg, yg, col = 'dodgerblue', nlevels = 20)
#' plot(m, add = TRUE)
#' polygon(tzone)
#' plot(paths, add = TRUE, col = 'orange3')
#' plot(paths, add = TRUE, col = 'orange')
#'
#' # model with vertical flow due to area-sink
#' as <- areasink(xc = 0, yc = 0, N = 0.001, R = 1500)
Expand All @@ -245,9 +245,9 @@ outside_vertical <- function(aem, x, y, z, ...) {
#' # starting z0 locations are above aquifer top and will be reset to top with warning
#' paths <- tracelines(m, x0 = x0, y0 = y0, z0 = top + 0.5, times = times)
#'
#' contours(m, xg, yg, col = 'dodgerblue3', nlevels = 20)
#' contours(m, xg, yg, col = 'dodgerblue', nlevels = 20)
#' plot(m, add = TRUE)
#' plot(paths, add = TRUE, col = 'orange3')
#' plot(paths, add = TRUE, col = 'orange')
#'
#' # plot vertical cross-section of traceline 4 along increasing y-axis (from south to north)
#' plot(paths[[4]][,c('y', 'z')], type = 'l')
Expand Down Expand Up @@ -372,9 +372,9 @@ endpoints <- function(tracelines, ...) {
#' xg <- seq(-800, 800, length = 100)
#' yg <- seq(-500, 500, length = 100)
#'
#' contours(m, xg, yg, col = 'dodgerblue3', nlevels = 20)
#' contours(m, xg, yg, col = 'dodgerblue', nlevels = 20)
#' plot(cp5, add = TRUE)
#' plot(cp10, add = TRUE, col = 'orange3')
#' plot(cp10, add = TRUE, col = 'orange')
#'
#' # model with vertical flow components
#' as <- areasink(0, 0, N = 0.001, R = 1500)
Expand All @@ -384,7 +384,7 @@ endpoints <- function(tracelines, ...) {
#' cp5a <- capzone(m, w1, time = 5*365, zstart = base)
#' cp5b <- capzone(m, w1, time = 5*365, zstart = 8)
#'
#' contours(m, xg, yg, col = 'dodgerblue3', nlevels = 20)
#' contours(m, xg, yg, col = 'dodgerblue', nlevels = 20)
#' plot(cp5a, add = TRUE)
#' plot(cp5b, add = TRUE, col = 'forestgreen') # smaller zone
#'
Expand Down
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ dirflow <- function(aem, x, y, angle,
#' m <- aem(k = 10, top = 10, base = 0, n = 0.2, rf, uf)
#'
#' xg <- seq(-500, 500, l=100); yg <- seq(-300, 300, l=100)
#' contours(m, xg, yg, col='dodgerblue3', nlevels=20)
#' contours(m, xg, yg, col='dodgerblue', nlevels=20)
#'
#' x0 <- -200
#' y0 <- -50
Expand All @@ -160,7 +160,7 @@ dirflow <- function(aem, x, y, angle,
#'
#' w <- well(125, 200, 150)
#' m <- aem(k = 10, top = 10, base = 0, n = 0.2, rf, uf, w)
#' contours(m, xg, yg, col='dodgerblue3', nlevels=20)
#' contours(m, xg, yg, col='dodgerblue', nlevels=20)
#' lines(matrix(c(x0, y0, x1, y1), ncol = 2, byrow = TRUE))
#'
#' flow_through_line(m, x0, y0, x1, y1, flow = 'darcy')
Expand Down
2 changes: 1 addition & 1 deletion man/aem.Rd

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

6 changes: 3 additions & 3 deletions man/capzone.Rd

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

6 changes: 3 additions & 3 deletions man/contours.Rd

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

4 changes: 2 additions & 2 deletions man/flow_through_line.Rd

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

24 changes: 12 additions & 12 deletions man/tracelines.Rd

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

0 comments on commit 140f7be

Please sign in to comment.