These are the default scales for mixtime vectors, which are usually used for a plot automatically. To override the scales behaviour manually, use scale_*_mixtime.

scale_x_mixtime(
  name = waiver(),
  breaks = waiver(),
  time_breaks = waiver(),
  labels = waiver(),
  time_labels = waiver(),
  minor_breaks = waiver(),
  time_minor_breaks = waiver(),
  common_time = waiver(),
  warps = waiver(),
  time_warps = waiver(),
  limits = NULL,
  expand = waiver(),
  oob = scales::censor,
  guide = waiver(),
  position = "bottom",
  sec.axis = waiver()
)

Arguments

name

The name of the scale. Used as the axis or legend title. If waiver(), the default, the name of the scale is taken from the first mapping used for that aesthetic. If NULL, the legend title will be omitted.

breaks

One of:

  • NULL for no breaks

  • waiver() for the breaks specified by date_breaks

  • A Date/POSIXct vector giving positions of breaks

  • A function that takes the limits as input and returns breaks as output

time_breaks

A giving the distance between breaks like "2 weeks", or "10 years". If both breaks and time_breaks are specified, time_breaks wins.

labels

One of:

  • NULL for no labels

  • waiver() for the default labels computed by the transformation object

  • A character vector giving labels (must be same length as breaks)

  • An expression vector (must be the same length as breaks). See ?plotmath for details.

  • A function that takes the breaks as input and returns labels as output. Also accepts rlang lambda function notation.

minor_breaks

One of:

  • NULL for no breaks

  • waiver() for the breaks specified by date_minor_breaks

  • A Date/POSIXct vector giving positions of minor breaks

  • A function that takes the limits as input and returns minor breaks as output

time_minor_breaks

A giving the distance between minor breaks like "2 weeks", or "10 years". If both minor_breaks and time_minor_breaks are specified, time_minor_breaks wins.

warps

Warp the time scale to have a consistent length, one of:

  • NULL or waiver() for no warping (the default)

  • A mixtime vector giving positions of warping points

  • A function that takes the limits as input and returns warping points as output

time_warps

A giving the distance between temporal warping like "2 weeks", or "10 years". If both warps and time_warps are specified, time_warps wins.

limits

One of:

  • NULL to use the default scale range

  • A numeric vector of length two providing limits of the scale. Use NA to refer to the existing minimum or maximum

  • A function that accepts the existing (automatic) limits and returns new limits. Also accepts rlang lambda function notation. Note that setting limits on positional scales will remove data outside of the limits. If the purpose is to zoom, use the limit argument in the coordinate system (see coord_cartesian()).

expand

For position scales, a vector of range expansion constants used to add some padding around the data to ensure that they are placed some distance away from the axes. Use the convenience function expansion() to generate the values for the expand argument. The defaults are to expand the scale by 5% on each side for continuous variables, and by 0.6 units on each side for discrete variables.

oob

One of:

  • Function that handles limits outside of the scale limits (out of bounds). Also accepts rlang lambda function notation.

  • The default (scales::censor()) replaces out of bounds values with NA.

  • scales::squish() for squishing out of bounds values into range.

  • scales::squish_infinite() for squishing infinite values into range.

guide

A function used to create a guide or its name. See guides() for more information.

position

For position scales, The position of the axis. left or right for y axes, top or bottom for x axes.

sec.axis

sec_axis() is used to specify a secondary axis.

loops

Loop the time scale around a calendrical granularity, one of:

  • NULL or waiver() for no wrapping (the default)

  • A mixtime vector giving positions of wrapping points

  • A function that takes the limits as input and returns wrapping points as output

time_loops

A mixtime::duration giving the distance between temporal loops like "2 weeks", or "10 years". If both loops and time_loops are specified, time_loops wins.

civil_time

The positioning of zoned time. If TRUE time is positioned uses the local/wall time (the default), otherwise time will be shown in with absolute/continuous UTC time.