← Back to all sparks
S

scales

ANALYTICS
Velocity0.0

Scale functions, breaks, labels and transformations for data visualization in R

scales keeps widening what ggplot2 can put on an axis.

rggplot2data-visualizationaxis-labelsextensibility
Current state
scales supplies the breaks, labels and transformations behind ggplot2's axes and legends. Unlike much of the tidyverse infrastructure around it, it still ships genuine feature work each release: native timespan handling in 1.3.0, then custom range-training classes and label_glue() in 1.4.0.
Where it's heading
The arc runs toward extensibility and type coverage. First came built-in support for awkward types like difftime and hms; 1.4.0 inverts that by letting any third-party class participate in range training simply by implementing range() or levels(). Labelling is getting more expressive rather than merely more numerous.
Prediction
Expect continued type-support and labelling work, with extension points that let downstream packages plug in their own classes instead of scales enumerating every one.

Recent moves

  1. 1y ago

    scales 1.4.0 opens range training to custom classes

    Range training opens up to custom classes: continuous types need a range() method, discrete types a levels() method. Paired with label_glue() for interpolated label strings and unsorted-range handling in fullseq(), this is the extensibility turn the package has been building toward.

    View source ↗
  2. 2y ago

    scales 1.3.0 makes timespans first-class on axes

    Substantial type work centred on durations: label_timespan(), breaks_timespan() and transform_timespan() together make difftime objects first-class on an axis, with rescale() gaining a difftime method. Also stops rescale(I(x)) from altering values it was asked to leave alone.

    View source ↗
  3. 3y ago

    scales 1.2.1 re-documents to fix .Rd HTML issues

    A re-documentation pass fixing HTML in the .Rd files. CRAN hygiene with no functional change.

    View source ↗
  4. 4y ago

    scales 1.2.0 fixes currency sign order and adds scale_cut

    Number formatting gets serious: style_positive and style_negative control sign presentation, the prefix finally lands after the negative sign so currency reads -$1 rather than $-1, and scale_cut allows different parts of a range to be scaled independently. Small details that decide whether a chart looks professional.

    View source ↗
  5. 6y ago

    scales 1.1.1 fixes palette inversion and adds oob_keep()

    A cluster of correctness fixes with real plotting consequences: hue_pal() properly inverts palettes at direction = -1, breaks_width() handles difftime and hms, and precision() copes with duplicates and mixed finite values. New oob_keep() lets data outside the range survive.

    View source ↗
  6. 6y ago

    scales 1.1.0 reorganises breaks and labels into a naming scheme

    The naming reorganisation that gave the package its current shape: functions generating breaks from limits became breaks_, those generating labels from breaks became labels_. Label functions also start preserving names and passing NAs through instead of dropping them.

    View source ↗