generating plot