scales icon indicating copy to clipboard operation
scales copied to clipboard

Add `signed` option for negative numbers in `label_log()`

Open teunbrand opened this issue 1 year ago • 0 comments
trafficstars

This PR aims to fix #421.

Briefly, is adds a signed argument controlling wether + or - prefixes should be used. By default, this is applied when negative numbers or zeroes are present in the numbers to label.

Reprex from the issue:

devtools::load_all("~/packages/scales/")
#> ℹ Loading scales

demo_continuous(
  c(-100, 100),
  transform = "asinh",
  breaks = c(-100, -10, -1, 0, 1, 10, 100),
  labels = label_log()
)
#> scale_x_continuous(transform = "asinh", breaks = c(-100, -10, 
#>     -1, 0, 1, 10, 100), labels = label_log())

Created on 2024-04-08 with reprex v2.1.0

teunbrand avatar Apr 08 '24 14:04 teunbrand