Skip to content

Instantly share code, notes, and snippets.

@blackfist
Created August 1, 2014 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blackfist/3bea37287ed87a18c907 to your computer and use it in GitHub Desktop.
Save blackfist/3bea37287ed87a18c907 to your computer and use it in GitHub Desktop.
library(verisr)
library(RColorBrewer)
library(ggplot2)
vcdb <- json2veris('~/Documents/development/python/vcdb/data/json')
origin <- getenum(vcdb, "actor")
colors <- brewer.pal(3, "Set2")
gg <- ggplot(origin, aes(x=enum, y=freq)) + geom_bar(stat="identity", fill=colors[1])
gg <- gg + coord_flip() + theme_bw()
gg <- gg + geom_text(aes(label = paste(sprintf("%.1f", freq*100), "%", sep=""), y=freq+0.05))
gg <- gg + labs(title="Origin of threat actors", x="", y=" ")
png(filename='~/Desktop/actor_origin.png', width=600, height=400)
print(gg)
dev.off()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment