Correction calculation error margin 

Correction calculation error margin 
Merge pull request #929 from hizhengfu/master

Fix an error in plot offset calculation.