      y: y_data[i],
        text: sample_pairs,
        type: 'scatter',
        mode: 'markers',
        marker: {size: size, color:colors[i]},
        showlegend:true,
    })
}

traces_b.push(heat_data)

Plotly.newPlot('plotb', traces_b, layout_b)
Plotly.newPlot('plota', traces_a, layout_a)

jQuery('#plotb_select').on('change', function() {
    var metric = this.value
    layout_b.title = jQuery("#plotb_select option:selected").text();
    heat_data.z = get_heat_data(input, metric)
    Plotly.redraw('plot