added the codes to recreate the plots