temospena / Rnotebook

a compilation of R chunks
http://web.tecnico.ulisboa.pt/~rosamfelix/r/COMPILACAO.html
1 stars 0 forks source link

Labels in balls plot #1

Open temospena opened 4 years ago

temospena commented 4 years ago
##adicionar esta maneira de ver os labels nas bolas
ggplot(dft_summary, aes(B3types, T0class)) +
  geom_point(aes(size=count, colour=factor(prob)))+scale_color_manual(values = c("#00BA38", "#F8766D","#619CFF")) +
  geom_text(data=dft_summary[dft_summary$count>25,],aes(label = count), size=4) +
  geom_text(data=dft_summary[dft_summary$count<25,],aes(label = count), hjust=-1,vjust=-1, size=4) +
  scale_size(range = c(1, 30))   + theme(legend.position="none") +
  labs(title = "Types of potential cyclists", x = "Stages of Change", y = "Change class")
temospena commented 4 years ago

actualizar para se ver os labels nas barras

https://stackoverflow.com/questions/22231124/how-to-draw-stacked-bars-in-ggplot2-that-show-percentages-based-on-group geom_text(aes(label = label), position = position_stack(vjust = 0.5), size = 2)

remover o JLutis, e o stat_fill_labels