record data sample and plot