Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: re: speed of R graphics vs Stata graphics

From   "Airey, David C" <david.airey@Vanderbilt.Edu>
To   "" <>
Subject   st: re: speed of R graphics vs Stata graphics
Date   Wed, 1 Sep 2010 18:53:32 -0500


> I was cutting my teeth on some graphics related analysis of gene microarrays using R Bioconductor packages. In some of the plots there may be 10K to 40K data points. I noticed a significant speed advantage to the R graphics in such plots with many symbols, and with trellis (panel) graphics. To confirm my impression I plotted 100K points generated using corr2data with a correlation of 0.5 in Stata and R using scatter y x and with(mydata(plot(x,y)). Stata draws each symbol as you watch and took 9 seconds. R draws the plot off screen and then it appears after less than 3 seconds. I'm using StataMP 11.1 and R 2.11.1.
> (1) Anybody notice this speed advantage to R with graphics?
> (2) Anybody notice Stata and R about both have 11.1 in their version numbers?

Now this is fascinating:

. scatter y x, ms(oh) aspect(1)
r; t=8.57 18:45:15

. scatter y x, ms(oh) aspect(1) mlw(vthin)
r; t=8.45 18:46:14

. scatter y x, ms(oh) aspect(1) mlw(vvthin)
r; t=7.73 18:48:59

. scatter y x, ms(point) aspect(1) 
r; t=6.21 18:49:44

It takes less time in Stata to graph smaller symbols or symbols with less paint!
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index