'change x limits with percent scale in ggplot histogram

I am trying to plot histogram. I wish to set x-axis limit from 50% to 60%.

tbl <- tibble(x = runif(n = 100, min = 53, max = 58))

ggplot(tbl, 
       aes(x = x)) + 
  geom_histogram(bins = 50) + 
  theme_bw() + 
  scale_x_continuous(labels = scales::percent_format(scale = 1, 
                                                     limits = c(50, 60))) 



Solution 1:[1]

Your limits are not in the right place:

scale_x_continuous(labels = scales::percent_format(scale = 1), 
                     limits = c(50, 60))

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Fred-LM