ggplot2 histogram of frequencies and axis formatting comma instead is scientific in facet_grid()

I did this code and the rendering has a combination fo numeric and scientific format. I would like to have an all axis with a numeric comma format. Any idea how to set it up

mydata %>% filter (Debit == '1', Segment %in% c("Private Banking","Domestic Preferred", "International Retail Banking","Premium" ,"Domestic Personal/Retail")) %>%
ggplot(aes(x =TransactionAmount ))+
geom_histogram(breaks = seq(0, 2600, by =200),color = "Steelblue3", fill = "Steelblue3", labels = comma)+
facet_grid(~Segment, scales = "free_x")+
coord_flip()+mytheme_x

note: mytheme_x is a ggplot formating predefined by myself

There is a comma option here:

I think you are looking for

  scale_y_continuous(labels =  scales::comma)
1 Like

It did work,
+scale_y_continuous(labels = label_number())
Thanks

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.