Sets limits, increments, line and text parameters of x- or y-axis of an scplot object.

set_xaxis(
  object,
  limits = NULL,
  increment = NULL,
  increment_from = NULL,
  line = NULL,
  expand = NULL,
  ...
)

set_yaxis(
  object,
  limits = NULL,
  increment = NULL,
  increment_from = NULL,
  line = NULL,
  expand = NULL,
  ...
)

Arguments

object

An scplot object (class scplot) returned from the scplot() function.

limits

Lower and upper limits of the axis (e.g., limits = c(0, 20) sets the axis to a scale from 0 to 20). With multiple single-cases you can use limits = c(0, NA) to scale the axis from 0 to the maximum of each case. limits is not set by default, which makes scplot set a proper scale based on the given data.

increment

An integer. Increment of the x-axis. 1 :each mt value will be printed, 2 : every other value, 3 : every third values etc. If NULL, scplot chooses an appropriate increment based on the data.

increment_from

Number from which increment starts to count. Usually set to 0 if you want marks like 1,5,10,15,... on the axis. If NULL, scplot chooses an appropriate value based on the data.

line

List with line parameters ("colour", "linewidth", "linetype", "lineend", "arrow"). See element_line().

expand

Vector with two values. Expansion of the axis. First value expands the lower end of the axis, second value the upper end. Default is c(0,0), meaning no expansion. You can also use relative values, e.g. c(0.05, 0.05) to expand both ends by 5 percent of the total axis length. See ggplot2::scale_x_continuous() for details.

...

Further styling arguments: color, size, face, family, hjust, vjust, lineheight, angle, linetype, lineend, arrow, fill, margin.

Value

An object of class scplot (seescplot()) with changed xaxis and yaxis elements. Also, the theme element is changed to reflect line and text parameters.