rejection sampling plotting code