automatically generate file names and legend from parameters for easier modification
Resolved merge conflict.