adding plot function

adding plot function