tickformatter_printf {rbokeh} | R Documentation

## Tick formatter based on a printf-style format string.

### Description

Tick formatter based on a printf-style format string.

### Usage

    tickformatter_printf(format = "%s", clear = FALSE)

### Arguments

`format` | The number format, as defined in the details below.
`clear` | A logical indicating whether all non-specified parameters should be cleared out of any exising specification in the figure. This can be useful when modifying a previously-defined figure.

### Details

The placeholder in the format string is marked by

- An optional "+" sign Causes the result to be preceded with a plus or minus sign on numeric values. By default, only the "-" sign is used on negative numbers.

- An optional padding specifier Specifies what (if any) character to use for padding. Possible values are 0 or any other character preceded by a "'" (single quote). The default is to pad with spaces.

- An optional "-" sign Causes sprintf to left-align the result of this placeholder. The default is to right-align the result.

- An optional number Specifies how many characters the result should have. If the value to be returned is shorter than this number, the result will be padded.

- An optional precision modifier Consists of a "." (dot) followed by a number, specifies how many digits should be displayed for floating point numbers. When used on a string, it causes the result to be truncated.

- A type specifier Can be any of:

  - "%" — yields a literal "%" character

  - "b" — yields an integer as a binary number

  - "c" — yields an integer as the character with that ASCII value

  - "d" or "i" — yields an integer as a signed decimal number

  - "e" — yields a float using scientific notation

  - "u" — yields an integer as an unsigned decimal number

  - "f" — yields a float as is

  - "o" — yields an integer as an octal number

  - "s" — yields a string as is

  - "x" — yields an integer as a hexadecimal number (lower-case)

  - "X" — yields an integer as a hexadecimal number (upper-case

### Value

A specification that is used as the `tickformatter` argument for `x_axis` or `y_axis`.

### Examples

    figure() %>%
      ly_points(1:10) %>%
      x_axis(tickformatter = tickformatter_printf(format = "%5.3f mu"))

[Package rbokeh version 0.6.3 Index]