I need to generate a bar chart with the following data:
structure(c(38792L, 1227L, 23220L, 4177L, 893L, 331L), .Dim = 6L, .Dimnames = structure(list(c("Canvas para Android", "Canvas para iOS", "Chrome ", "Firefox ", "Navegador não reconhecido", "Safari ")), .Names = ""), class = "table")
I need to group the "Canvas for Android" and "Canvas for iOS" bars, just below them I must put a label "Mobile Device" and also need to group the other bars by adding a "Computer" logo.
I made the chart as follows:
AgUsuPlot<- barplot(table(AgenteDoUsuario[,1]),
main = "Distribuição de Frequência do Agente do Usuário",
ylim = c(0,45000),
xlab="Agente do Usuário",
col = c("palegreen", "green", "orange", "darkred", "red", "darkblue"),
ylab="Exibições de Páginas",
legend = rownames(table(AgenteDoUsuario[,1])),
cex.axis = 0.6,
cex.names = 0.6,
space = 0.5,
las=1
)
text(x=AgUsuPlot, y=table(AgenteDoUsuario[,1]), label=table(AgenteDoUsuario[,1]), pos = 3, xpd=NA)
I would like to know how I can decrease the caption, as it is getting on top of one of the bars.