plot and as.data.frame implemented