Generating graph for plot2