Plotly.py: Hover info broken in 3D scatter plot with opacity 1

Created on 2 Mar 2018  路  17Comments  路  Source: plotly/plotly.py

Hi,
in 3D scatter when marker opacity is set to 1 and when you hover over any point only one hover label is shown. Specifically it is the label belonging to the first point in data. See for yourself:

x, y, z = np.random.multivariate_normal(np.array([0,0,0]), np.eye(3), 200).transpose()
trace1 = go.Scatter3d(
    x=x,
    y=y,
    z=z,
    mode='markers',
    marker=dict(
        size=12,
        line=dict(
            color='rgba(217, 217, 217, 0.14)',
            width=0.5
        ),
        opacity=1
    )
)

data = [trace1]
layout = go.Layout(
    margin=dict(
        l=0,
        r=0,
        b=0,
        t=0
    )
)
fig = go.Figure(data=data, layout=layout)
plotly.offline.iplot(fig)

scatter plot

question

All 17 comments

Hi there,
The above code does not produce an issue for me:

3d

Can you confirm that you're using an updated version of the python api: 2.4.1?

Hi @cldougl,
I have updated to 2.4.1 but I still see this issue. I run python 3.6.3.
plotly_hover_2

Hey @michalkahle,
I'm still unable to reproduce with python 3.6 - can you confirm:

  • you only see this issue with opacity=1 (as noted in the title)?
  • which version of jupyter you're using?
  • which browser/version you're using?

Yes it only happens with opacity 1 (or > 1). When there are more traces they must have all opacity >=1 and this issue happens only to the first trace; the rest is fine.

I'm using Chromium Version 64.0.3282.167 but I see this issue with Firefox as well.

My jupyter server:
image

I fixed this provisionally by adding this fake trace to the beginning of the list:
go.Scatter3d(x=[0], y=[0], z=[0], marker={'color':'rgb(0, 0, 0)', 'opacity': 1, 'size': 0.1}, showlegend=False).

Thanks, @michalkahle, that fix worked nicely for me.

Hi @michalkahle , I'm not able to reproduce this issue with plotly.py 3.2.1 in firefox or chrome. Could you give it a try once more with the latest plotly.py? If you still have the problem, I'd like to see if we can translate it into pure JavaScript to get something for the plotly.js folks to look at. Thanks!

Hi all, I can reproduce the same issue, with online plotting too.
Here are my specs:

  • python 3.5.2
  • plotly 3.2.1
  • Ubuntu 16.04.4 LTS
  • Firefox Quantum 62.0.3

Thanks for the info @WolfLo ,
@michalkahle , could you let us know what operating system you're using? Thanks!
-Jon

Thanks for the info @WolfLo ,
@michalkahle , could you let us know what operating system you're using? Thanks!
-Jon

Is not Ubuntu 16.04.4 LTS a sufficient information about my operating system? what else do you need?
Thanks!

Hi @WolfLo , yes that's sufficient. I was asking @michalkahle if he could share his info as well. Thanks!

Hi @jonmmease , sorry for taking long to respond. I just tried to upgrade do plotly.py 3.3.0 and the issue is still there. My OS is also Ubuntu 16.04. And now I also tested with Chrome 69 on Windows 7 (32bit) in a VM and the issue is not present there. :(

Thanks @michalkahle! Well maybe there is something about Ubuntu 16.04 here...

Hi @michalkahle and @WolfLo, could you try this CodePen example on Ubuntu 16.04 (and on any other OSs you have access to) and let us know if the problem exists there?

https://codepen.io/jonmmease/pen/aRQvqM

If you can reproduce on this example, then we've ruled out plotly.py and can move this issue to the plotly.js repo. Thanks!

@jonmmease I tested your example and I can reproduce the issue when I set the opacity to 1 and dragmode to true. I've since upgraded to Ubuntu 18.04 and the issue still present.

https://codepen.io/michalkahle/pen/vVbKZb

@michalkahle @jonmmease I think we may close this issue which could be fixed in https://github.com/plotly/plotly.js/issues/3258.

Thank you @archmoj ! I can confirm the issue is gone in plotly for python v. 3.5.0 on Ubuntu.

Was this page helpful?
0 / 5 - 0 ratings