0

I want to label my X-axis at the decile points. I am using the ggplot() for the pareto chart I have drawn and by default the X-axis is labelled at 0,33,66,100 percent (or may be due to code). I have used this code but I don't have much idea where to edit it to get the decile points:

pareto<-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=8)) + labs(x="Customer",y="Product Share (%)") +ggtitle("Pareto Chart") +ylim(0,100.1)
print(pareto)

cummulative is the data frame and also attached is image.enter image description here

Abhishek Singh
  • 187
  • 2
  • 13
  • So you want to change the x-axis labels? And if so, then the `3x10^6` should be the `100%`? – Roman Jun 23 '16 at 09:48
  • Yes. I also have to convert these scientific numbers to thousands and label them in deciles. For example. total is 3*10^6 so it should be labelled at 10,20,30....100 and in the form of 3000(thousands) – Abhishek Singh Jun 23 '16 at 09:50
  • Ok, to make it easier to help you, please provide a reproducible example using for instance `dput(cummulative)`. And post the output in your question. – Roman Jun 23 '16 at 10:36
  • so my data has nearly 3 million and i want to label them at deciles which would be at 30k,60k....300k. I have pasted the image by editing the question. By defaults the labels are at 0,33,66,100 percents. – Abhishek Singh Jun 23 '16 at 10:42
  • Then please check this http://stackoverflow.com/questions/17764140/ggplot2-customised-x-axis-ticks ot the help page for `scale_x_continuous()` or provide some reproducible data. – Roman Jun 23 '16 at 10:48
  • Hey thanks. I used scale_x_continous() and then saw your comment was regarding that only. Thanks a lot :) – Abhishek Singh Jun 24 '16 at 05:24

0 Answers0