我有一個有百萬記錄的帕累託圖。對於Y軸,我使用了Pareto.Chart()函數並顯示四分位數。對於x軸,我有數以百萬計的記錄,並使用scale_x_continuous()顯示十分位的x點,但我想顯示10 20 30 ... 100而不是數字。這裏是它是如何的形象和我多麼希望它如何標籤帕雷託圖爲十進制只顯示10 20等等
我已經使用GGPLOT2和QCC這裏。我已經使用pareto.chart()函數只是爲了得到累積性的金額,然後在Y.用它下面是部分代碼:
revenue<-custfinal$Revenue
names(revenue)<-custfinal$customerid
cummulative<-abspareto(revenue, ylab = "Revenue", xlab="Customer", xaxt="n")
cummulative<-data.frame(cummulative)
paretorevenue<-ggplot(data=cummulative,
aes(x = seq(1,length(cummulative$Frequency)),y=Cum.Percent.,group=1)) + geom_line(colour="red", size=1) + theme_classic() + theme(axis.text.x = element_text(angle = 75, hjust = 1, size=12)) + labs(x="Number of Customer",y="Revenue Share (%)") +ggtitle("Revenue generated distribution for Yogurt 2016") +ylim(0,100.1)+scale_x_continuous(breaks = round(seq(0,length(cummulative$Frequency),length(cummulative$Frequency)/10),-3))
print(paretorevenue)
abspareto()的東西,我在pareto.chart已經編輯(),所以它只是給了我一個累贅的部分。
哦,我很抱歉....你採取了正確的樣板...連續「a」的目的是什麼...原諒我我不知道任何關於R很多隻是學習我會嘗試這並回復你 –
@AbhishekSingh看到我的編輯。 – Jimbou
哦,我不知道我可以使用標籤和休息。萬分感謝 –