Hi,
I've got a code such as:
data_long <- structure(list(percentil = c(5, 5, 5, 15, 15, 15, 25, 25, 25,
35, 35, 35, 45, 45, 45, 50, 50, 50, 55, 55, 55, 65, 65, 65, 75,
75, 75, 85, 85, 85, 95, 95, 95),
type = structure(c(1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L,
2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L),
levels = c("pivo", "víno", "lihoviny"),
class = "factor"),
value = c(0.824, 0.556, 0.774, 0.838, 0.631, 0.839, 0.846, 0.666, 0.866, 0.859, 0.697,
0.889, 0.873, 0.721, 0.908, 0.88, 0.732, 0.917, 0.886, 0.741,
0.925, 0.903, 0.767, 0.947, 0.929, 0.814, 0.98, 0.977, 0.901,
1.043, 1.164, 1.137, 1.281)),
row.names = c(NA, -33L),
class = c("tbl_df", "tbl", "data.frame"))
library(ggplot2)
ggplot(data_long, aes(x = percentil, y = value, fill = type)) +
geom_bar(position="dodge", stat="identity") +
scale_fill_manual(values = c("#00254B", "#ECB925", "#A6A6A6")) +
theme_minimal() +
theme(legend.position = 'bottom',
legend.margin=margin(0,0,0,0),
legend.title = element_blank(),
text = element_text(size = 15),
axis.text.x = element_text(size = 13),
axis.text.y = element_text(size = 13,
angle = 0,
hjust = 0.7),
axis.title.x = element_text(size = 11.5),
plot.margin = margin(20, 20, 20, 20),
axis.title.y = element_blank(),
panel.spacing = unit(2, "lines"),
panel.grid.major.y = element_blank()) +
xlab("") +
scale_y_continuous(name = "",
label = scales::percent_format(accuracy = 1, scale = 100, prefix = "", suffix = " %",
big.mark = " ", decimal.mark = ","))
Yet I want my y-axis to start at 1 (100 %) (see picture below). I've tried Google but I guess I don't know the right keyword.
I will apreaciate your help!