call Resample(), call myplot.Close at the end of main()