I have a code segment like this in R, which I use for plotting:
plot_bar <- function(x, y, min, max, color = plot_colors[2]) {
p <- ggplot(data.frame(as.integer(x), y)) +
geom_bar(aes(x, y), stat = "identity", position = "dodge", fill = color) + ylim(min, max) +
theme_light() + theme(text = element_text(size = 25), axis.title.x = element_blank(), axis.title.y = element_blank())
return(p)
}
This works for me, and produces something like this:
Basically, the (-2,+2)
is passed to my plot from values of min
and max
arguments in the function. But the problem is that, instead of (-2.+2)
for y-axis I want to have (-0.1%,+0.1%)
. Is it possible to change the text in the y-axis?