Avoid Scatter traces

For an application that I’m working on, I have plotted each datapoint as a separate trace, because then they show up in the bar on the right. When I move the curser around, Plotly ‘highlights’ these traces (all of them). I would like none of them. See picture (screen dump). It’s easy enough to disable the hoverinfo (=‘none’) but that’s not what I’m after. I have created an on-click event with a Heatmap and when I click anywhere on the chart, multiple points show up in the JSON container. I need only the pixel located at or very near my cursor - not any of the traces. Please note in the below chart, that everything that has ‘similar’ x-axis value shows up, which means my cursor can be far away from the trace and it still shows up (for example the BL2 at y = 0 in attached screen shot). I hope my problem is clear. Here’s bits and pieces of my code the way it looks now:

  aligndict = {}                                        # Initialize aligndict
  aligndict = alignment.alignments(float(spk['qts']))   # Add alignments to aligndict
  for plotlabel in aligndict:
     output = aligndict[plotlabel]
     alpha = float(output['alpha'])
     h_p = float(output['h'])
     plot_alignchart.append(                            # plot alignments
        go.Scatter(
           x=[alpha],
           y=[h_p],
           name=plotlabel,
           mode='markers',
           marker=dict(
              size=12
           ),
           text=plotlabel,
           hovertemplate=None
           # hovermode='closest'    # this is the default ...
           # hovermode=False  # No solution: https://community.plotly.com/t/completely-excluding-a-trace-from-hover-info-snapping/35854/12
        )                     
     )

And the Heatmap:

  plot_alignchart.append(
     go.Heatmap(z=zmap, x=xmap, y=ymap,
        connectgaps=True,
        showscale=False,
        opacity=0,
        hoverinfo='none',
        visible=True)
  )

When I click the Align Chart in the application, the x and y coordinates of the pixel where I clicked indeed does show up, but so does all the traces that are near the same x-value (even quite far away, actually).

I know that I can combine all the alignments in ‘aligndict’ into a single trace, but then their individual bullets with their labels disappear, and I still have one too many x and y value.

Best regards,
Claus

I should add that elsewhere in the code I define the layout for this plot:

        yaxis = {'title':'h = fp/fs',
            'showline':True,
            'mirror':True}
        layout = go.Layout(
           hoverdistance=1,
           xaxis={'type':'log',
                  'title':'alpha = Vas/Vb',
                  'showline':True,
                  'mirror':True,
                  'range':(np.log10(xmin),np.log10(xmax))},
           yaxis=yaxis,
           font={'size':18},
           legend={'orientation':'v'}
       )

I cannot set hoverdistance=0 because it disables the click-event entirely (also for the Heatmap). As far as I know it is not possible to specify different hoverdistances for the traces in Scatter versus the Heatmap, but that would indeed have been a solution to my problem.

Best regards,
Claus

After two hard weeks (mostly weekends) I found my solution. Instead of hoverinfo=‘none’ I just select to ‘skip’ the ones that are Scatter plotted, like this:

     plot_alignchart.append(                            # plot alignments
        go.Scatter(
           x=[alpha],
           y=[h_p],
           name=plotlabel,
           mode='markers',
           marker=dict(
              size=12
           ),
           text=plotlabel,
           hoverinfo='skip',
           hovertemplate=None
        )
     )

Best regards,
Claus