changed default image to PDF and fixed ggplot initialisation