adding helper function for plotting univariate