added possibility to plot the figures in windows