Просто дайте новый labels
вашей x
переменной
library(tidyverse)
ggplot(myData, aes(x = fct_reorder(x, -y), y = y)) +
geom_col(width = 0.5) +
scale_x_discrete(breaks = c("windows", "macos", "html5"),
labels = c("Windows", "MacOS", "HTML5"))
# or
my_x_labels <- setNames(c("Windows", "MacOS", "HTML5"),
c("windows", "macos", "html5"))
ggplot(myData, aes(x = fct_reorder(x, -y), y = y)) +
geom_col(width = 0.5) +
scale_x_discrete(labels = my_x_labels) +
theme_minimal()
# or
myData <- myData %>%
mutate(x = factor(x,
levels = c("windows", "macos", "html5"),
labels = c("Windows", "MacOS", "HTML5")))
ggplot(myData, aes(x = fct_reorder(x, -y), y = y)) +
geom_col(width = 0.5)
Созданона 2019-11-10 представьте пакет (v0.3.0)