A function that renders a plot directly to PDF without any GUI.