made plotting of y-axis labels more generic