I am trying to change the x-axis orientation of the bar plot but it does not work. This is the code I am using
res1PM$Source <- "Reserva 1P"
res2PM$Source <- "Reserva 2P"
res3PM$Source <- "Reserva 3P"
reservas_totalesM <- rbind(res1PM, res2PM, res3PM)
aM <- ggplot(reservas_totalesM, aes(x = CAMPO_OFICIAL, y = VOLUMEN_ORIGINAL_PETROLEO_MMB, fill = Source)) +
geom_bar(stat = "identity", position = position_stack()) +
labs(x = "Campos", y = "Reservas [MMbls]", fill = "Referencia") +
ggtitle("Reservas totales de aceite en campos marinos") +
scale_fill_brewer(palette = "Greens") +
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) +
theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
theme_minimal()
aM_interactivo <- ggplotly(aM)
aM_interactivo