Fix generation of pdf graphs