Skip to content

Wrong dots displaying while using px.scatter_3d() or go.Scatter3d() #4347

Closed as not planned
@vertrue

Description

@vertrue

macOS Monterey 12.6.7
Python 3.10.11
plotly 5.16.1

All the dots are strange. Looks like they are not in the right places. You can check screen recording for better understanding.

import plotly.graph_objects as go

x = [713803.7330273491, 713803.98913199, 713804.2452366309, 713804.5013412718, 713804.7574459127, 713805.0135505536, 713805.2696551945, 713805.5257598354, 713805.7818644762, 713806.037969117, 713806.294073758, 713806.5501783988, 713806.8062830397, 713807.0623876806, 713807.3184923215, 713807.5745969624, 713807.8307016033, 713808.0868062442, 713808.3429108851, 713808.599015526]
y = [4935389.037155528, 4935389.125768517, 4935389.214381507, 4935389.302994497, 4935389.391607487, 4935389.480220477, 4935389.568833467, 4935389.657446457, 4935389.746059447, 4935389.834672437, 4935389.923285427, 4935390.011898416, 4935390.100511407, 4935390.189124396, 4935390.2777373865, 4935390.366350376, 4935390.4549633665, 4935390.543576356, 4935390.6321893465, 4935390.720802336]
z = [291.3159140183369, 291.2966768180801, 291.27758816453695, 291.25864805200047, 291.23985647480833, 291.2212134273426, 291.2027189040298, 291.1843728993407, 291.16617540779816, 291.14812642394645, 291.13022594239715, 291.112473957799, 291.0948704648447, 291.0774154582713, 291.06010893286077, 291.04295088343883, 291.0259413048759, 291.0090801920869, 290.99236754003084, 290.9758033437114]

fig = go.Figure(data=go.Scatter3d(x=x, y=y, z=z))

fig.show()
Screenshot 2023-09-04 at 22 18 11
Screen.Recording.2023-09-04.at.21.48.23.mov

If you will try to build same set of dots in matplotlib, you will obtain more realistic results:

import matplotlib.pyplot as put

fig = plt.figure()
ax = fig.add_subplot(projection='3d')
ax.scatter(x, y, z)

plt.show()
Screenshot 2023-09-04 at 22 22 45 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions