Skip to contents

Very convenient to erase the axes for post plot axis redrawing using post_plot().

Reinitialize and set the graphic parameters before plotting.

CANNOT be used if no graphic device already opened.

Usage

prior_plot(
  param.reinitial = FALSE,
  xlog.scale = FALSE,
  ylog.scale = FALSE,
  remove.label = TRUE,
  remove.x.axis = TRUE,
  remove.y.axis = TRUE,
  std.x.range = TRUE,
  std.y.range = TRUE,
  down.space = 1,
  left.space = 1,
  up.space = 1,
  right.space = 1,
  orient = 1,
  dist.legend = 3.5,
  tick.length = 0.5,
  box.type = "n",
  amplif.label = 1,
  amplif.axis = 1,
  display.extend = FALSE,
  return.par = FALSE,
  safer_check = TRUE
)

Arguments

param.reinitial

Single logical value. Reinitialize graphic parameters before applying the new ones, as defined by the other arguments? Either TRUE or FALSE.

xlog.scale

Single logical value. Log scale for the x-axis? Either TRUE or FALSE. If TRUE, erases the x-axis, except legend, for further drawing by post_plot()(xlog argument of par()).

ylog.scale

Single logical value. Log scale for the y-axis? Either TRUE or FALSE. If TRUE, erases the y-axis, except legend, for further drawing by post_plot()(ylog argument of par()).

remove.label

Single logical value. Remove labels (axis legend) of the two axes? Either TRUE or FALSE (ann argument of par()).

remove.x.axis

Single logical value. Remove x-axis except legend? Either TRUE or FALSE (control the xaxt argument of par()). Automately set to TRUE if xlog.scale == TRUE.

remove.y.axis

Single logical value. Remove y-axis except legend? Either TRUE or FALSE (control the yaxt argument of par()). Automately set to TRUE if ylog.scale == TRUE.

std.x.range

Single logical value. Standard range on the x-axis? TRUE (no range extend) or FALSE (4% range extend). Controls xaxs argument of par() (TRUE is xaxs = "i", FALSE is xaxs = "r").

std.y.range

Single logical value. Standard range on the y-axis? TRUE (no range extend) or FALSE (4% range extend). Controls yaxs argument of par() (TRUE is yaxs = "i", FALSE is yaxs = "r").

down.space

Single positive numeric value indicating the lower vertical margin (in inches, mai argument of par()).

left.space

Single positive numeric value indicating the left horizontal margin (in inches, mai argument of par()).

up.space

Single positive numeric value indicating the upper vertical margin between plot region and grapical window (in inches, mai argument of par()).

right.space

Single positive numeric value indicating the right horizontal margin (in inches, mai argument of par()).

orient

Single positive numeric value indicating the scale number orientation (las argument of par()). 0, always parallel to the axis; 1, always horizontal; 2, always perpendicular to the axis; 3, always vertical.

dist.legend

Single positive numeric value that moves axis legends away in inches (first number of mgp argument of par() but in inches thus / 0.2).

tick.length

Single positive numeric value indicating the length of the ticks (1 means complete the distance between the plot region and the axis numbers, 0.5 means half the length, etc. 0 means no tick.

box.type

The bty argument of par(). Either "o", "l", "7", "c", "u", "]", the resulting box resembles the corresponding upper case letter. A value of "n" suppresses the box.

amplif.label

Single positive numeric value to increase or decrease the size of the text in legends.

amplif.axis

Single positive numeric value to increase or decrease the size of the scale numbers in axis.

display.extend

Single logical value. Extend display beyond plotting region? Either TRUE or FALSE (xpd argument of par() without NA).

return.par

Single logical value. Return graphic parameter modification?

safer_check

Single logical value. Perform some "safer" checks (see https://github.com/safer-r)? If TRUE, checkings are performed before main code running: 1) R classical operators (like "<-") not overwritten by another package because of the R scope and 2) required functions and related packages effectively present in local R lybraries. Set to FALSE if this fonction is used inside another "safer" function to avoid pointless multiple checkings.

Value

Graphic parameter modification.

Author

Gael Millot <gael.millot@pasteur.fr>

Yushi Han <yushi.han2000@gmail.com>

Haiding Wang <wanghaiding442@gmail.com>

Examples

if (FALSE) { # \dontrun{
# Screen devices should not be used in examples
prior_plot(param.reinitial = FALSE, xlog.scale = FALSE, ylog.scale = FALSE, remove.label = TRUE, remove.x.axis = TRUE, remove.y.axis = TRUE, std.x.range = TRUE, std.y.range = TRUE, down.space = 1, left.space = 1, up.space = 1, right.space = 1, orient = 1, dist.legend = 4.5, tick.length = 0.5, box.type = "n", amplif.label = 1, amplif.axis = 1, display.extend = FALSE, return.par = FALSE)
} # }