function category_guides(main_plot) {
let prediction_groups = main_plot.selectAll('g').data(nested_data)
.enter().append('g').attr('transform', d => 'translate('+cat_scale_x(d.key)+',0)')
prediction_groups.append('line')
.attr('x1',0).attr('x2',0)
.attr('y1',0).attr('y2',height)
.attr('stroke', d => cat_scale_color[d.key])
.attr('stroke-width', 3)
prediction_groups.append('text')
.text(d => d.key)
.attr('class', 'thecat')
.attr('x', 0).attr('y', -3)
.attr('text-anchor', 'middle').attr('font-size', '14px').attr('font-family', 'serif').attr('font-weight', 'bold')
.attr('fill', d => cat_scale_color[d.key])
let scores_scale = d3.scaleLinear().domain([0,1]).range([height,0]).nice()
let scores_axis = d3.axisLeft(scores_scale)
.tickValues(d3.range(0,1.00001,1/(n_bins))).tickFormat(d3.format('.2'))
main_plot.append('g').attr('transform', 'translate(-5,0)').call(scores_axis)
return prediction_groups
}