Thanks for pointing this out. For backtesting I use the adjusted close price which accounts for splits and dividend payments.
This plot here is only for display purposes where I use the close price that's why you see the large jumps during splits. I will switch over to using adjusted close prices as well which will resolve the issue.