So there’s actually a few things that can be causing this issue with your device.
* The primary suspect could be an issue with the phone’s software. Make sure that the device is up to date. If anything else a forced reset of the device can help the issue.
* The second suspect issue could be overheating or extreme cold. Definitely see if the issue continues if the phone is in a neutral environment.
* If your phone is using a screen protector, definitely try removing the protector and see if the issue continues.
If all else fails, then it may be a defect in the screen that could be causing the issue. This would mean that the a replacement screen would be needed.