我有以下图表使用library(waffle)
我的问题是没有出现姓氏组。我正在使用的代码如下
counts<-c(135.92, 15.98, 14.97, 14.15, 5.82, 11.82, 0.07 )
counts_names<-sprintf("%s (%s)", c("Coal", "Gas", "Wind", "Hydro", "Grid-scalar solar", "Rooftop solar", "Storage systems"),
scales::percent(round(counts/sum(counts), 4)))
names(counts)<-counts_names
Generation_graph<-waffle(counts)+ scale_fill_tableau(name=NULL)
我怎样才能得到我的原始图表与右边的七组
更新:阅读其中一条评论时,我注意到包含该选项labels
使我能够保留所有名称的原始图表。
Generation_graph<-waffle(counts)+ scale_fill_tableau(name=NULL, labels=counts_names)