Skip to content

Commit

Permalink
add note to plot_scatter
Browse files Browse the repository at this point in the history
  • Loading branch information
tgoodbody committed Jan 27, 2023
1 parent 2e2460e commit ab8f7d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 5 additions & 4 deletions R/utils-plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#' @inheritParams extract_metrics
#' @param dfc data.frame. Values for mraster and mraster2
#' @param coordsgrps List. Cartesian coordinates of each strata
#' @param samp Numeric. Determines proportion of cells to plot
#' @param reverse Logical. Reverse x and y axis
#' @family plot
#' @name plot
#' @return Scatter plot of available raster cells coloured and delineated by stratum.
Expand Down Expand Up @@ -63,6 +61,9 @@ classPlot <- function(dfc,
#' @family plot
#' @rdname plot
#' @keywords internal
#' @param samp Numeric. Determines proportion of cells to plot
#' @param reverse Logical. Reverse x and y axis
#' @note Population in dark grey and samples in red.
#' @export

plot_scatter <- function(mraster,
Expand Down Expand Up @@ -121,14 +122,14 @@ plot_scatter <- function(mraster,

if(isFALSE(reverse)){
p <- ggplot2::ggplot(data = vals, mapping = ggplot2::aes(x = .data[[x]], y = .data[[y]])) +
ggplot2::geom_point(alpha = 0.3, color = "#333333") +
ggplot2::geom_point(color = "#333333") +
ggplot2::geom_point(data = samples, color = "red") +
ggplot2::theme_bw() +
ggplot2::theme(legend.position = "none")

} else {
p <- ggplot2::ggplot(data = vals, mapping = ggplot2::aes(x = .data[[y]], y = .data[[x]])) +
ggplot2::geom_point(alpha = 0.3, color = "#333333") +
ggplot2::geom_point(color = "#333333") +
ggplot2::geom_point(data = samples, color = "red") +
ggplot2::theme_bw() +
ggplot2::theme(legend.position = "none")
Expand Down
3 changes: 3 additions & 0 deletions man/plot.Rd

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

0 comments on commit ab8f7d2

Please sign in to comment.