You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I often use labels = percent in ggplot axes to make percentages explicit, which has been very helpful.
In scales v0.5.0, the default led to rounding the axes labels to whole number percentages (0%, 25%, 50%, ) but in v1.0.0 those get rounded as 0.0%, 25.0%, 50.0%, which is inefficient. Is this intended behavior, and if so what's the best way to set percent_format(accuracy = 1) as default without typing each time?
scales v0.5.0 seemed to be able to differentiate rounding in axes vs. rounding in values. In the example below, v0.5.0 had rounded the axes to whole numbers, but retained accuracy = 0.1 in the text labels, which seemed like the right defaults.
library(tidyverse)
library(scales)
#> #> Attaching package: 'scales'#> The following object is masked from 'package:purrr':#> #> discard#> The following object is masked from 'package:readr':#> #> col_factorvals<- rbeta(10, 1, 1)
df<- tibble(x= sample(vals), y= sample(vals))
ggplot(df, aes(x, y)) +
geom_point() +
geom_text(aes(label= percent(y)), nudge_y=0.02) +
scale_x_continuous(labels=percent) +
scale_y_continuous(labels=percent)
I often use
labels = percent
in ggplot axes to make percentages explicit, which has been very helpful.In scales v0.5.0, the default led to rounding the axes labels to whole number percentages (0%, 25%, 50%, ) but in v1.0.0 those get rounded as 0.0%, 25.0%, 50.0%, which is inefficient. Is this intended behavior, and if so what's the best way to set
percent_format(accuracy = 1)
as default without typing each time?scales v0.5.0 seemed to be able to differentiate rounding in axes vs. rounding in values. In the example below, v0.5.0 had rounded the axes to whole numbers, but retained
accuracy = 0.1
in the text labels, which seemed like the right defaults.Created on 2018-12-08 by the reprex package (v0.2.1)
The text was updated successfully, but these errors were encountered: