scales 1.0.0 Unreleased

New Features


Transformations & breaks

  • boxcox_trans() is now invertible for x >= 0 and requires positive values. A new argument offset allows specification of both type-1 and type-2 Box-Cox transformations (@dpseidel, #103).

  • log_breaks() returns integer multiples of integer powers of base when finer breaks are needed (@ThierryO, #117).

  • New function modulus_trans() implements the modulus transformation for positive and negative values (@dpseidel).

  • New pseudo_log_trans() for transforming numerics into a signed logarithmic scale with a smooth transition to a linear scale around 0 (@lepennec, #106).

Minor bug fixes and improvements

scales 0.5.0 2017-08-24

scales 0.4.1 2016-11-09

scales 0.4.0 2016-02-26

  • Switched from NEWS to

  • manual_pal() produces a warning if n is greater than the number of values in the palette (@jrnold, #68).

  • precision(0) now returns 1, which means percent(0) now returns 0% (#50).

  • scale_continuous() uses a more correct check for numeric values.

  • NaN is correctly recognised as a missing value by the gradient palettes (ggplot2-1482).

scales 0.3.0 2015-08-25

  • rescale() preserves missing values in input when the range of x is (effectively) 0 (ggplot2-985).

  • Continuous colour palettes now use colour_ramp() instead of colorRamp(). This only supports interpolation in Lab colour space, but is hundreds of times faster.

scales 0.2.5 2015-06-12

Improved formatting functions

New colour scaling functions

Other bug fixes and minor improvements

scales 0.2.4 2014-04-22

  • Eliminate stringr dependency.

  • Fix outstanding errors in R CMD check.

scales 0.2.3 2012-12-05

  • floor_time() calls to_time(), but that function was moved into a function so it was no longer available in the scales namespace. Now floor_time() has its own copy of that function (Thanks to Stefan Novak).

  • Color palettes generated by brewer_pal() no longer give warnings when fewer than 3 colors are requested (@wch).

  • abs_area() and rescale_max() functions have been added, for scaling the area of points to be proportional to their value. These are used by scale_size_area() in ggplot2.

scales 0.2.2 2012-09-04

  • zero_range() has improved behaviour thanks to Brian Diggs.

  • brewer_pal() complains if you give it an incorrect palette type. (Fixes #15, thanks to Jean-Olivier Irisson).

  • shape_pal() warns if asked for more than 6 values. (Fixes #16, thanks to Jean-Olivier Irisson).

  • time_trans() gains an optional argument tz to specify the time zone to use for the times. If not specified, it will be guess from the first input with a non-null time zone.

  • date_trans() and time_trans() now check that their inputs are of the correct type. This prevents ggplot2 scales from silently giving incorrect outputs when given incorrect inputs.

  • Change the default breaks algorithm for cbreaks() and trans_new(). Previously it was pretty_breaks(), and now it’s extended_breaks(), which uses the extended() algorithm from the labeling package.

  • fixed namespace problem with fullseq().

scales 0.2.1 2012-05-08

  • suppressWarnings from train_continuous() so zero-row or all infinite data frames don’t potentially cause problems.

  • check for zero-length colour in gradient_n_pal().

  • added extended_breaks() which implements an extension to Wilkinson’s labelling approach, as implemented in the labeling package. This should generally produce nicer breaks than pretty_breaks().

  • alpha() can now preserve existing alpha values if alpha() is missing.

  • log_breaks() always gives breaks evenly spaced on the log scale, never evenly spaced on the data scale. This will result in really bad breaks for some ranges (e.g 0.5-0.6), but you probably shouldn’t be using log scales in that situation anyway.

scales 0.2.0 2012-02-27

  • censor() and squish() gain only.finite argument and default to operating only on finite values. This is needed for ggplot2, and reflects the use of Inf and -Inf as special values.

  • bounds functions now force evaluation of range to avoid bug with S3 method dispatch inside primitive functions (e.g. [).

  • Simplified algorithm for discrete_range() that is robust to stringsAsFactors global option. Now, the order of a factor will only be preserved if the full factor is the first object seen, and all subsequent inputs are subsets of the levels of the original factor.

  • scientific() ensures output is always in scientific format and off the specified number of significant digits. comma() ensures output is never in scientific format (Fixes #7).

  • Another tweak to zero_range() to better detect when a range has zero length (Fixes #6).