Gráfico de Barras
p1 <- ggplot(df_plot, aes(x = reorder(Animal, -Total), y = Total, fill = Animal)) +
geom_bar(stat = "identity", width = 0.7) +
scale_fill_manual(values = paleta_cores) +
scale_y_continuous(limits = c(0, 10000)) +
labs(
title = "Casos de Intoxicação por Animal peçonhento",
fill = "Animal",
x = "Animal",
y = "Número de casos"
) +
theme_minimal() +
theme(
plot.title = element_text(hjust = 0.5, size = 16, face = "bold"),
plot.subtitle = element_text(hjust = 0.5, size = 12, color = "gray40"),
axis.text.x = element_text(angle = 45, hjust = 1, size = 10),
axis.title = element_text(size = 12, face = "bold"),
legend.position = "right"
) +
geom_text(aes(label = Total), vjust = -0.5, size = 4)
p1

Gráfico de Pizza
par(mar = c(2, 2, 3, 2))
pie(df_plot$Total,
main = "Percentual de casos de intoxicação por animal peçonhento",
labels = paste0(df_plot$Animal, "\n", df_plot$Porcentagem, "%"),
col = paleta_cores,
cex.main = 1.3,
font.main = 2,
border = "black",
radius = 1)
legend("topright",
fill = paleta_cores,
legend = df_plot$Animal,
bty = "n",
cex = 0.9)
