So I have this data table
   AA  BB  CC  DD
W1 3.5 3.5 3.4 3.5
w2 3.4 3.7 3.6 3.5
w3 3.5 3.4 3.5 3.5
w4 3.5 3.4 3.5 3.5
w5 3.5 3.4 3.5 3.5
w6 3.5 3.4 3.5 3.5
w7 3.5 3.4 3.5 3.5
w8 3.5 3.4 3.5 3.5
and code
qw<-barplot(as.matrix(t(tabela.matrix1)), beside=TRUE, 
           col=c("yellow", "cornflowerblue", "yellowgreen","orchid4"))
text(qw, 0, round(as.matrix(t(tabela.matrix1)), 1),cex=1,pos=3,srt=90) 
#legend("bottom",
     # c("AA","BB","CC", "DD"),
      # fill=terrain.colors(4)
)
Now I would like to plot this barplots, place the legend outside barplot and also rotate leters w1, w2, w3, w4... for 45 degrees.:
Picture above was created in excel.


 
     
    
 
    

 
    