Created
August 1, 2014 19:13
-
-
Save blackfist/3bea37287ed87a18c907 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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