Reputation: 3384
Sample data
library(ggplot2)
ggplot(ToothGrowth, aes(x=dose, y=len)) + geom_boxplot()
My attempt
ggplot(ToothGrowth, aes(x=dose, y=len)) + geom_boxplot() + ylab(len == 10, "ten")
Here the goal is to replace '10' on the y-axis with "ten"
Upvotes: 2
Views: 402
Reputation: 24252
If you need to replace on the y-axis only the value 10 with "Ten", you can use this solution:
library(databases)
library(ggplot2)
ggplot(ToothGrowth, aes(x=dose, y=len, group=1)) + geom_boxplot() +
scale_y_continuous(label=function(x) ifelse(x==10,"Ten",x))
Upvotes: 1