added legend to third panel
fixed legend spacing