If there are two ways to do the same thing, and one of them has an obvious gotcha then lets scrap that way!
I think you should change the variable ```pp``` to ```pdf``` and just use that to save the fig rather than showing two possible ways...