added legend and possibility to plot from file