How can I change the Y-axis figures into percentages in a barplot? Ask Question

How can I change the Y-axis figures into percentages in a barplot? Ask Question

How can we change y axis to percent like the figure? I can change y axis range but I can't make it to percent. ここに画像の説明を入力してください

ベストアンサー1

Use:

+ scale_y_continuous(labels = scales::percent)

Or, to specify formatting parameters for the percent:

+ scale_y_continuous(labels = scales::percent_format(accuracy = 1))

(the command labels = percent is obsolete since version 2.2.1 of ggplot2)

おすすめ記事