rdf2pdf.py: dirname removed from plot legend
minor logic bug fixed