plotly / plotly/plotly.py

scene aspectmodes "cube" or "manual" do not work with Scatter3D

Open
#2,511 6 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

Example from the plotly docs, with aspect mode set to cube.

import plotly.graph_objects as go
import numpy as np

# Helix equation
t = np.linspace(0, 10, 50)
x, y, z = np.cos(t), np.sin(t), t

layout = go.Layout(scene=dict(aspectmode="cube"))

fig = go.Figure(
	data=[go.Scatter3d(x=x, y=y, z=z,mode='markers')],
	layout=layout)
fig.show()

On the x and y axis, one grid unit is length 0.5. On the z axis one grid unit is length 2.
Screen Shot 2020-05-27 at 1 09 15 PM

These should be displayed with equal lengths if the aspect ratio is a cube. Same issue with 'go.Layout(scene=dict(aspectmode="manual", aspectratio=dict(x=1, y=1, z=1)))'

This help post indicates this should work or worked in the past cc @empet
https://community.plotly.com/t/creating-a-3d-scatterplot-with-equal-scale-along-all-axes/15108

Thank you.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided Python example with go.Layout(scene=dict(aspectmode="cube")) and compare the rendered x, y, and z grid-unit lengths. Reproduce the same check with aspectmode="manual" and aspectratio=dict(x=1, y=1, z=1). Done means both settings display equal axis lengths for the Scatter3d scene.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.