improve diagram plot