For better visualization, I need to move the strip text of the facets to be on top of each facet.
Now they are on the right side, but I need them on top.
This is my code:
tvs.rangos <- ggplot(tvs , aes(rangos))
tvs.rangos + geom_histogram(aes(fill = marca), width = .7) + labs(title = "Marcas de TV por rangos de precios",
x = "rango de precios", y = "cantidad de tvs") +
facet_grid(ecommerce ~ .) +
scale_fill_brewer(palette="Set3") +
theme(axis.text.x = element_text(colour="grey10",size=16,hjust=.5,vjust=.5,face="bold"),
axis.text.y = element_text(colour="grey10",size=18,,hjust=1,vjust=0,face="plain"),
axis.title.x = element_text(colour="grey40",size=12,angle=0,hjust=.5,vjust=0,face="plain"),
axis.title.y = element_text(colour="grey40",size=12,angle=90,hjust=.5,vjust=.5,face="plain"),
plot.title = element_text(size = 16,vjust=2),
legend.title = element_text(colour="grey40", size=16, face="bold"),
legend.text = element_text(colour="grey10", size=16, face="bold"),
strip.text.y = element_text(size = 20, angle = 0))
I've found this topic:
ggplot2: Using gtable to move strip labels to top of panel for facet_grid
But, I'm looking for a simplier approach, if any.