簡體   English   中英

在堆積條形圖中,如何繪制每個條形從 x 軸開始的變量(垂直)不同類別的條形?

[英]In a stacked bar plot,How do u plot bars of different categories of a variable (vertically) where every bar starts from x-axis?

http://www.bing.com/images/search?q=stacked+bar+chart&view=detailv2&id=CD8EFAE719BFA5FCA1AB1EA6DAA22363E76EAD13&selectedindex=1&ccid=lTsHf2uz&simid=608041385567914091&thid=OIP.M953b077f6bb366647d008eda5ec12aa7H0&mode=overlay&first=1

在上圖中,在第 9 場比賽中,A 隊得分 400(得分軸:0-400),B 隊得分 90(得分軸:400-490),C 隊得分 410(490-900)

我應該怎么做才能得到一個條形圖,其中每場比賽的所有三支球隊的得分條都從 x 軸開始? (低頻條應該是可見的,而不是與高頻條疊加)

例如 A 隊得分 400(得分軸:0-400),B 隊得分 90(得分軸:0-90),C 隊得分 410(0-410)

需要 R 或 excel 中的解決方案

最好的可視化解決方案在於 rCharts 包

圖書館(rCharts)

n1 <- nPlot(score ~ Match, group = "Team", data = player, type = "multiBarChart")
n1

如果你想在github上發布,你也可以這樣做

n1$publish("玩家", host = 'gist')

如果要另存為 html

n1$save("Player.html")

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM