安全数据处理与数据库技术探讨
1. 处理VCDB数据
1.1 绘制柱状图
可以使用以下代码绘制柱状图:
gg <- ggplot(localdf, aes(x=enum, y=freq, label=lab))
gg <- gg + geom_bar(stat="identity", fill="steelblue")
# add in text, adjusted to the end of the bar
gg <- gg + geom_text(hjust=-0.1, size=3)
# flip the axes and add in a title
gg <- gg + coord_flip() + ggtitle(field)
# remove axes labels and add bw theme
gg <- gg + xlab("") + ylab("") + theme_bw()
# fix the y scale to remove padding and fit our label (add 7%)
gg <- gg + scale_y_continuous(expand=c(0,0),
limits=c(0, max(localdf$freq)*1.1))
# make it slightly prettier than the default
gg <- gg + theme(panel.grid.major = element_blank(),
panel.
超级会员免费看
订阅专栏 解锁全文
1379

被折叠的 条评论
为什么被折叠?



