plot_sample function

It makes a plot by sampling (e.g. monthly) the variables x and y