我有以下数据:
loan_amnt term grade sub_grade home_ownership verification_status d_status
7000 60 months C C5 RENT Not Verified Not Defaulted
6500 60 months C C3 OWN Not Verified Not Defaulted
12000 36 months B B5 OWN Verified Defaulted
9000 36 months C C1 RENT Verified Not Defaulted
1000 36 months D D1 RENT Not Verified Defaulted
我需要多变量条形图,其中我希望内部填充 d_status
,y轴具有值的百分比 . 在x轴我想要 term
, grade
和 verification_status
. 这意味着我将需要3个堆叠的条形图 .
如何使用ggplot绘图?请帮忙 .
1 回答
您可以使用
gridExtra
库 .结果是: