Grafico de Barras
par(mar = c(6, 6, 5, 2))
bp <- barplot(
casos,
names.arg = animais,
col = cores,
main = "Casos de Intoxicacao por Animal Peconhento\nBrasil - 2005",
xlab = "Animal",
ylab = "Numero de Casos",
ylim = c(0, max(casos) * 1.25),
border = "white",
las = 1
)
text(
bp,
casos + 200,
labels = format(casos, big.mark = "."),
cex = 0.9,
font = 2
)
## Warning in prettyNum(.Internal(format(x, trim, digits, nsmall, width, 3L, :
## 'big.mark' e 'decimal.mark' são ambos '.', o que pode ser confuso
legend(
"topright",
legend = paste0(animais, " (", pct, "%)"),
fill = cores,
title = "Animal e Percentual",
bty = "n",
cex = 0.9
)

Grafico de Pizza
rotulos <- paste0(animais, "\n", pct, "%")
pie(
casos,
labels = rotulos,
col = cores,
main = "Distribuicao dos Casos por Animal Peconhento\nBrasil - 2005",
cex = 0.95,
cex.main = 1.1
)
legend(
"bottomright",
legend = paste0(animais, " - ", format(casos, big.mark = "."), " casos"),
fill = cores,
title = "Animal e Total de Casos",
bty = "n",
cex = 0.85
)
## Warning in prettyNum(.Internal(format(x, trim, digits, nsmall, width, 3L, :
## 'big.mark' e 'decimal.mark' são ambos '.', o que pode ser confuso
