racinej at mcmaster.ca
2008-Oct-22 21:50 UTC
[Rd] Potential improvement to boxplot when outline=FALSE is set? (PR#13196)
Hi. I have recently noticed that when using boxplot with outline=FALSE, the default ylim (xlim if horizontal=TRUE) might be improved on. The default can result in much wasted display and hard to read plots. A simple snippet of test code is given below that illustrates the issue along with a suggested improvement. Thanks ever so much for your wonderful and ongoing contributions to the open source community. ## Demonstration code to illustrate that when outline=FALSE in ## boxplots, ylim (or xlim when horizontal=TRUE is set) might be ## better set. set.seed(12345) x <- rchisq(10000,df=1) par(mfrow=c(2,1)) ## Default wastes much graphics display space... boxplot(x,outline=FALSE) ## This simple modification can rectify the situation... ylim=c(max(min(x),quantile(x,.25)-1.5*IQR(x)), min(max(x),quantile(x,.75)+1.5*IQR(x))) boxplot(x,outline=FALSE,ylim=ylim) ## End of demonstration code Note that when using lists, the one would compute, say, max(min(x),quantile(x,.25)-1.5*IQR(x)) for each element of the list and take the minimum over each of these to get the lower bound for ylim (xlim if horizontal=FALSE). Thanks for giving this your consideration. -- Jeff -- Professor J. S. Racine Phone: (905) 525 9140 x 23825 Department of Economics FAX: (905) 521-8232 McMaster University e-mail: racinej at mcmaster.ca 1280 Main St. W.,Hamilton, URL: http://www.economics.mcmaster.ca/racine/ Ontario, Canada. L8S 4M4 `The generation of random numbers is too important to be left to chance'
Maybe Matching Threads
- Package np update (0.30-6) adds nonparametric entropy test functionality...
- Package np update (0.30-6) adds nonparametric entropy test functionality...
- Versions 0.50-1 of the np and npRmpi packages released - new features and deprecated options…
- Versions 0.50-1 of the np and npRmpi packages released - new features and deprecated options…
- Package np version 0.20-0 released to CRAN