How to change the position of bars/columns and how to place caption

Asked

Viewed 32 times

0

ggplot(data = dados, aes(x = Meses,y = T.max, width = 777600))+ 
  geom_bar(aes(y = T.max), fill="red", stat = "identity",position = "dodge" ) +  
  geom_bar(aes(y = T.med), fill="blue", stat = "identity",position = "dodge") +
  geom_bar(aes(y = T.min), fill="black", stat = "identity",position = "dodge") +
  geom_line(aes(y = P.max/4),col = "green",size = 1,group = 1) +
  scale_y_continuous(sec.axis = sec_axis(~./0.25, name = "Precipitação (mm)")) +
  labs(y = "Temperatura", x = "Meses") +   theme_bw()+
  theme(panel.grid.major = element_blank(), 
        panel.grid.minor = element_blank()) 

I have the following problems -I need to place the bars/columns side by side because in my data I have the following information T.max,Tmed,Tmin (the position command "Dodge") is not working

  • Legend does not appear

inserir a descrição da imagem aqui

1 answer

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.