update plot

updated plot function to accept minimum of 2 rows