working refactored plotting.diagnostics