COSMIT: move percentile out of plotting