User Tools

Site Tools


lab:zhang:plot_running_time_for_bmem
y<-array(c(2.05, 4.13, 15, 2.79, 5.03, 16.24, 8.41, 15.34, 50.13, 20.35, 33.37, 125.46), dim=c(3,4))

plot(c(100,200,500,1000),y[1,], ylim=c(0,130), xlab='Sample size', ylab='Time (seconds)')
lines(c(100,200,500,1000),y[1,])

points(c(100,200,500,1000),y[2,])
lines(c(100,200,500,1000),y[2,],lty=2)

points(c(100,200,500,1000),y[3,])
lines(c(100,200,500,1000),y[3,],lty=3)

## for 10%
text(100, 2.05, '2.05', pos=1)
text(200, 2.79, '2.79', pos=1)
text(500, 8.41, '8.41', pos=1)
text(1000, 20.35, '20.35', pos=1)

## for 20%
text(100, 4.13, '4.13', pos=3)
text(200, 5.03, '5.03', pos=3)
text(500, 15.34, '15.34', pos=3)
text(1000, 33.37, '33.37', pos=3)

## for 40%
text(100, 15.00, '15.00', pos=3)
text(200, 16.24, '16.24', pos=3)
text(500, 50.13, '50.13', pos=3)
text(1000, 125.5, '125.5', pos=3)

legend('topleft', c('10%','20%','40%'), lty=c(1,2,3))

Page Tools