conditionally download file; better plot legend