Skip to content

Commit

Permalink
Try again with the basic plots
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhsparks committed Aug 1, 2024
1 parent 9eaa17d commit 1210831
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 64 deletions.
23 changes: 3 additions & 20 deletions R/plot_aagi.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,7 @@
#' @description Basic X-Y plotting that follows \acronym{AAGI} colour and
#' typography guidelines that uses (hopefully) sensible defaults.
#'
#' @param x Values to be plotted on x-axis.
#' @param y Values to be used on y-axis. Optional.
#' @param main Main title text.
#' @param sub Subtitle text below x-axis label.
#' @param xlab X-axis label. Optional, if blank will default to data supplied
#' label.
#' @param ylab Y-axis label. Optional, if blank will default to data supplied
#' label if one is available.
#' @param xlim Numeric value for x-axis limits. Optional.
#' @param ylim Numeric value for y-axis limits. Optional.
#' @param col Colour to use for points Defaults to "AAGI Black", a very dark
#' grey. Can be supplied as a named AAGI colour; *e.g.*, "AAGI Black";
#' a named colour, "black"; or a hexadecimal code, "#414042".
#' @param pch plotting ‘character’, \emph{i.e.}, symbol to use. This can either
#' be a single character or an integer code for one of a set of graphics
#' symbols. The full set of S symbols is available with `pch = 0:18`, see the
#' examples below. (NB: \R uses circles instead of the octagons used in S.)
#' @param type What type of plot should be drawn. Defaults to `p` for
#' **p**oints`` See Section "Type" for more.
#' @inheritParams graphics::plot
#' @param ... Arguments to be passed to methods, such as graphical parameters
#' (see [graphics::par()]). The most commonly used argument would be
#' `type` what type of plot should be drawn.
Expand Down Expand Up @@ -68,6 +50,7 @@
#'
plot_aagi <- function(x,
col = NULL,
pch = 16,
...) {

if (is.null(col)) {
Expand All @@ -79,6 +62,6 @@ plot_aagi <- function(x,

withr::local_par(.new = par_aagi())
showtext::showtext_begin()
graphics::plot(x, col = col2, ...)
graphics::plot(x, col = col2, pch = pch, ...)
showtext::showtext_end()
}
45 changes: 1 addition & 44 deletions man/plot_aagi.Rd

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

0 comments on commit 1210831

Please sign in to comment.