bugfix plotting figure into pdf