使用 ggplot 我已经制作了一个带有一些值的直方图。我想更改最高条的颜色,以使情节更清晰。
library(ggplot2)
ggplot(df,
aes(as.Date(created_at), as.numeric(count))) +
geom_col(fill = 'cornflowerblue') +
theme_minimal(base_size = 10) +
xlab(NULL) + ylab(NULL) +
scale_x_date(date_labels = "%Y/%m/%d",date_breaks = "days",expand = c(0,0)) + #El espaciado por días
theme(axis.text.x=element_text(angle=90, vjust = 0.5))+#Cambiamos la posición del x
geom_text(aes(label = count, y = count+50), position = position_dodge(0.9),angle=90, vjust = 0.5,size=3)+
ggplot2::theme(
plot.title = ggplot2::element_text(face = "bold",colour = "black"))+
ggplot2::labs(
x = NULL, y = NULL, #Info en cada eje
title = "Tweets sobre el COVID-19 por día", #Texto
subtitle = ""
)