The problem is not the python script. I run the code under two different version of the same IDE, one displays perfectly fine and the newer version is distorted.