它与传奇中的所有颜色相混淆。我尝试在每个栏下获得(最好旋转)标签。因此,我没有填充颜色,而是需要标签。
我玩过图书馆(直接标签)和其他一些东西,但没有成功。
示例代码:
Assets <- cbind(c(rep("Index",13),rep("Aktie",4),rep("Rohstoffe",6),rep("Währungen",3), rep("Bonds",4)),
c("DAX","MDAX","SDAX","TecDAX","CAC","FTSE","ATX","BUX","SandP","TA-100","TOPIX","DOW","NASDAQ","Asien","Europa","USA","Sonstige","Gold","Silber","OIL","Cotton","Sugar","Pork","USD-EUR","JPY-USD","JPY-EUR","BOBL","BUND","US_10","US_30"))
colnames(Assets) <- c("Asset_Cat","Asset_Name")
TestD <- data.frame(Land = sample(c("GER","UK","POL","CH","YP"), 1000, replace = T),
P1 = sample(1:100, 10000, T)*sample(1:100, 10000, T),
P2 = sample(1:100, 10000, T)*sample(1:100, 10000, T),
P3 = sample(1:100, 10000, T)*sample(1:100, 10000, T))
TestD <- cbind(Assets[sample(nrow(Assets), length(TestD$Land), replace = T), ],TestD)
ggplot(data = TestD, aes(x = Asset_Cat, y = P1, fill=Asset_Name)) +
geom_bar(stat = "identity", position = "dodge") +
labs(x="", y="Anzahl pro 1000 Datenpunkten") +
ggtitle("Eve") +
theme(legend.position="bottom")
我想要得到的东西: enter image description here